[Tutor] new print statement + time module

George Wahid geoterium at gmail.com
Sat Feb 28 05:34:07 CET 2009


I downloaded python 3.0.1 today and started experimenting with the new
print statement.

>>>import time
>>>for l in 'the answer':
...    print(l,end='')
...    time.sleep(0.1)

the code is supposed to print "the answer" with a 0.1 second long
pause between the letters. instead, it waits for 1 second (
0.1*len("the answer") seconds ) and then prints "the answer". what am
I doing wrong ?
both replacing print(l,end='') with print(l) or using the msvcrt
module instead of the print function work fine.


More information about the Tutor mailing list