我正在尝试遍历列表,并用ipython
打印数字和字母:
tuples = [(1, 'a'), (2, 'b'), (3, 'c')]
for number, letter in tuples:
print(number)
print(letter)
但是当我在ipython中尝试它时,它只能让我写第一个语句,然后返回输出:
In [34]: tuples = [(1, 'a'), (2, 'b'), (3, 'c')]
In [35]: for number, letter in tuples:
...: print(number)
1
2
3
如何在解释整个块之前添加另一条语句?