syntax error in Pyton shell

Christos TZOTZIOY Georgiou DLNXPEGFQVEB at spammotel.com
Mon Dec 30 03:15:06 EST 2002


On 3 Sep 2002 14:23:47 GMT, rumours say that bokr at oz.net (Bengt Richter)
might have written:

>It is annoying to have to resort (interactively) to:
>
> >>> if 1:
> ...     for i in range(5):
> ...         print i,
> ...     print '[output desired on same line].'
> ...
> 0 1 2 3 4 [output desired on same line].
>
>because this screws up:
>
> >>> for i in range(5):
> ...     print i,
> ... print '[output desired on same line].'
>   File "<string>", line 3
>     print '[output desired on same line].'
>         ^
> SyntaxError: invalid syntax

A very late (in days^Wmonths and time of day^Wnight :) reply:

>>> for i in range(5):
... 	print i,
... else:
... 	print "same line"
... 	
0 1 2 3 4 same line

Regards too,
-- 
TZOTZIOY, I speak England very best,
Real email address: 'dHpvdEBzaWwtdGVjLmdy\n'.decode('base64')



More information about the Python-list mailing list