If a trailing comma is added to the end of a print statement, the next statement is executed first. Why is this? For example, this executes 10000 ** 10000
before it prints "Hi "
:
print "Hi",
print 10000 ** 10000
And this takes a while before printing "Hi Hello":
def sayHello():
for i in [0] * 100000000: pass
print "Hello"
print "Hi",
sayHello()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…