tutorial questions (examples fail).
Keith White
peche at dial.pipex.com
Sun Dec 26 09:26:54 EST 1999
am running 1.5.2
have printed the tutorial,and got as far as page 17.
here things go wrong.
in Defining functions the fibonacci example
fails both in interactive mode and if created as a script
with such things as
myfish at peche:~ > python
Python 1.5.2 (#3, Dec 26 1999, 13:32:19) [GCC egcs-2.91.66 19990314
(egcs-1.1.2 on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> def fib(n): # write Fibonacci series up to n
... "Print a Fibonacci series up to n"
File "<stdin>", line 2
"Print a Fibonacci series up to n"
^
SyntaxError: invalid syntax
as you can see i tried rebuilding python,etc.
but it doent work.
If i remove the function documentation i get this
>>> def fib(n): # etc,etc
... a, b = 0, 1
File "<stdin>", line 2
a, b = 0, 1
^
SyntaxError: invalid syntax
Help,whats going on.
Also i seem to have lost my command line editing facility in
rxvt and xterm whilst interactive.
--
Keith.
More information about the Python-list
mailing list