[Tutor] Can't print a string, gives me syntax error
Alan Gauld
alan.gauld at btinternet.com
Tue May 26 00:35:38 CEST 2009
"xbmuncher" <xboxmuncher at gmail.com> wrote
>I ran this in IDLE:
>>>> t = 'hi'
>>>> print t
> SyntaxError: invalid syntax (<pyshell#3>, line 1)
>
> I've also tried this as sample.py :
> import string
> text = 'hello world'
> print text
>
>
> It gives me a syntax error on "print text" line
Looks like you are using Python v3.
Most tutorials are still on v2.
print has changed significantly in v3, several things are
done differently. Try to find a v3 tutorial.
The basics section in mine is almost complete(see .sig)
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/l2p/
More information about the Tutor
mailing list