arnab_das
February 13th, 2010, 07:34 PM
Hi!
am learning to use python.
i am using the default gedit text editor (is that okay?)
#!/usr/bin/env python
1 name = input('What is your name?\n')
2 print 'Hi, ' + name + '.'
this is the script i typed. i saved it as hello.py
now i typed chmod u+x hello.py
next i typed ./hello.py
however the output i get is:
File "./hello.py", line 2
1 name = input('What is your name?\n')
^
SyntaxError: invalid syntax
what am i doing wrong? plz help.
am learning to use python.
i am using the default gedit text editor (is that okay?)
#!/usr/bin/env python
1 name = input('What is your name?\n')
2 print 'Hi, ' + name + '.'
this is the script i typed. i saved it as hello.py
now i typed chmod u+x hello.py
next i typed ./hello.py
however the output i get is:
File "./hello.py", line 2
1 name = input('What is your name?\n')
^
SyntaxError: invalid syntax
what am i doing wrong? plz help.