[Tutor] G'day

John Fouhy john at fouhy.net
Thu Feb 16 23:00:45 CET 2006


On 16/02/06, John Connors <oztriking at hotmail.com> wrote:
> My 1st dumb question: I have a copy of Teach Yourself Python in 24 Hours,
> printed in 2000 so I guess it's virtually usless but i was hoping to learn
> some of the basics from it. There is a small bit of code near the
> beginning...

Check out the tutorial on the website at http://python.org/.  Although
you might find some concepts have changed a bit since the basic days..

I've also heard that Alan Gauld's tutorial is pretty good:
http://www.freenetpages.co.uk/hp/alan.gauld/
Plus, the author is pretty responsive :-)

> print "Hello, World!"
>
> print ' 'Goodbye, World!"
>
> which returns a syntax error for the 2nd line. I thought it was a typo and
> changed it to print "Goodbye, World!".

Err, yeah.  That's a bit odd.  Strings in python are delimited either
by single quotes or double quotes, but you can't mix and match.

So, you could do this:
 print 'Hello world!'

or this:
 print "Hello world!"

but you can't replace a double quote with two single quotes.

--
John.


More information about the Tutor mailing list