Re: [Tutor] A total newbie…sorry
On 28/10/11 03:20, Joe Batt wrote: I am just starting to try to learn Python on IDLE on a Mac running Welcome, and don't worry thee are no stupid questions. And you've given us all the right info to answer too, well done! :-) Python 3.2.2 (v3.2.2:137e45f15c0b, Sep 3 2011, 17:28:59) and I have come unstuck at the very beginning I tried print Hello SyntaxError: invalid syntax the terminal using the same syntax it works Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) print Hello Hello I can see its a different version but what is the problem? Thats the problem. Python v3 has some big differences from v2. And print is one of them. You need to put the string inside parentheses: print (hello). But there are other subtle changes too. You don't mention what tutorial you are using to learn Python but it looks like it is based on v2 (as many are). So either you should install IDLE for v2.7 and carry on from there or find a tutorial for v3 and use that. If you can already program in another language then the official tutorial on the python web site is a good choice as it gets updated with each release. If you are a complete beginner to programming you could try mine (see below), but there are some others for v3 too. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] A total newbie…sorry
Alan Gauld wrote: On 28/10/11 03:20, Joe Batt wrote: I am just starting to try to learn Python on IDLE on a Mac running Welcome, and don't worry thee are no stupid questions. Was it you or your brother who was killed in the war? -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] A total newbie…sorry
On 28/10/11 08:46, Steven D'Aprano wrote: Alan Gauld wrote: On 28/10/11 03:20, Joe Batt wrote: I am just starting to try to learn Python on IDLE on a Mac running Welcome, and don't worry thee are no stupid questions. Was it you or your brother who was killed in the war? me :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] A total newbie…sorry
I am just starting to try to learn Python on IDLE on a Mac running Python 3.2.2 (v3.2.2:137e45f15c0b, Sep 3 2011, 17:28:59) and I have come unstuck at the very beginning I tried print HelloSyntaxError: invalid syntax print 'Hello'SyntaxError: invalid syntax print HelloSyntaxError: invalid syntax And as you can see its just saying invalid syntax yet if I run Python in the terminal using the same syntax it works Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwinType help, copyright, credits or license for more information. print HelloHello I can see its a different version but what is the problem? Many thanks and sorry for the VERY basic question :( Joe ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] A total newbie…sorry
The syntax has changed from 2.x to 3.x. 2.x: print Hello Hello 3.x: print(Hello) Hello -- Nick Zarczynski http://rentageekit.com Blog 4 http://nickzarr.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor