python豆知识: for和while的else语句。 for语句,当可迭代对象耗尽后执行else语句。 while循环,当条件为False后执行else。 a = 1 while a != 10: a += 1 else: print(a)