![]() |
Re: why not?
On Mon, 21 Jan 2013 11:02:10 -0600, kwakukwatiah 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(), Because the output will be different. The first code will print: 0: first line 1: second line 2: third line The second code will print: 0first line 1second line 2third line You should really try these things and see what they do before asking. -- Steven |
why not?
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(), |
| All times are GMT. The time now is 05:27 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.