Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37207

Re: why not?

From Lie Ryan <lie.1296@gmail.com>
Subject Re: why not?
Date 2013-01-22 02:56 +1100
References <8CAC60710F6447FFA746695B2D24522B@favour>
Newsgroups comp.lang.python
Message-ID <mailman.751.1358783791.2939.python-list@python.org> (permalink)

Show all headers | View raw


On 22/01/13 04:02, kwakukwatiah@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?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: why not? Lie Ryan <lie.1296@gmail.com> - 2013-01-22 02:56 +1100

csiph-web