如果您使用的是python 3.x:*_, last = iterator # for a better understanding check PEP 448print(last)如果您使用的是python 2.7:last = next(iterator)for last in iterator: continueprint last注意:通常上面提出的解决方案是,你需要定期的情况是什么,但如果你是在处理大数据量,这是更有效地使用一个deque大小1.(的来源)from collections import deque#aa is an interatoraa = iter('apple')dd = deque(aa, maxlen=1)last_element = dd.pop()