why not?

Lie Ryan lie.1296 at gmail.com
Mon Jan 21 10:56:15 EST 2013


On 22/01/13 04:02, kwakukwatiah at gmail.com wrote:
> f = open(r'c:\text\somefile.txt')
> for i in range(3):
>         print str(i) + ': ' + f.readline(),
> please with the print str(i) + ‘: ‘ + f.readline(), why not print str(i)
> + f.readline(),

Try running both code. What do you see? What's the difference? When do 
you think you might want one or the other?





More information about the Python-list mailing list