缓冲区丢了几个
运行下面这段程序(缓冲区最多装 2 个):
buf = []
dropped = 0
for i in range(5):
if len(buf) == 2:
dropped += 1
else:
buf.append(i)
print(dropped)
运行下面这段程序(缓冲区最多装 2 个):
buf = []
dropped = 0
for i in range(5):
if len(buf) == 2:
dropped += 1
else:
buf.append(i)
print(dropped)
全部评论