This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-09-28 23:53:59

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Ametur at Python, need help

(Gosh, I'm a noob!) I have the latest version of Python, yet I have the stupidest problem(it's probably me). Whenever I say- print "Hello"-(no dashes) it says invalid synatx. Can someone help me? Thanks.


Scratchin' since 2007

Offline

 

#2 2009-09-29 02:03:39

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Ametur at Python, need help

Hi adriangl,

if you're using Python 3 or above 'print' needs to be invoked as a function, not as a keyword. So the correct syntax would be

     print("Hello")


Jens Mönig

Offline

 

#3 2009-09-29 09:53:38

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Ametur at Python, need help

As Jens said, I'm working with 2.5 but the latest is 2.6

Offline

 

#4 2009-09-29 19:18:08

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: Ametur at Python, need help

Jens wrote:

Hi adriangl,

if you're using Python 3 or above 'print' needs to be invoked as a function, not as a keyword. So the correct syntax would be

     print("Hello")

Thanks. I don't know how I could of missed that....


Scratchin' since 2007

Offline

 

#5 2009-09-29 19:23:27

weswesrock
Scratcher
Registered: 2009-06-25
Posts: 500+

Re: Ametur at Python, need help

Off topic but,
I'm intrested in new programming languages, and I wonder if Python is good
Is it?

Offline

 

#6 2009-09-29 19:45:31

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Ametur at Python, need help

It's good. But there probably are other languages better than it.

Offline

 

#7 2009-09-29 19:53:03

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: Ametur at Python, need help

Magnie wrote:

It's good. But there probably are other languages better than it.

True, like actionscript, Java, and C.


Scratchin' since 2007

Offline

 

#8 2009-09-29 20:18:32

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Ametur at Python, need help

weswesrock wrote:

Off topic but,
I'm intrested in new programming languages, and I wonder if Python is good
Is it?

It's good, but a more beginner's language would be Just BASIC (And yes, I'm still standing up for it). It's ultra-easy and quite functional - try it out, there's a built-in tutorial.

Offline

 

Board footer