(no subject)

piet at cs.uu.nl piet at cs.uu.nl
Mon Jun 25 07:56:10 EDT 2001


>>>>> crombie <crombie88 at yahoo.com> (c) writes:

c> newbie question:
c> trying to type this in:
c> >>> a, b = 0, 1
c> >>> while b < 1000:
c> ...     print b,
c> ...     a, b = b, a+b
c> ... 
c> 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987


c> but result is this:
c> >>> while b< 10
c> SyntaxError: invalid syntax
c> >>> while b < 10:
c> ... print b
c> IndentationError: expected an indented block (line 2)
c> >>> while b < 10:
c> 	print b
c> 	a, b = b, a+b ...
	
Something was wrong here, as the interpreter didn't give the ... prompt.
Did you copy and paste this or enter it with some weird method?
Maybe you should have restarted the interpreter.

c> SyntaxError: invalid syntax
c> >>> while b < 1000:
c> ...	print b,
c> IndentationError: expected an indented block (line 2)
c> >>> while b < 1000:
c>    ...	print b,
   
c> SyntaxError: invalid syntax
c> >>> 

c> anyone know why?

Did you type the ... yourself?

-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list