1. 程式人生 > >python 第一步

python 第一步

>>> print "hello ,world!"
SyntaxError: invalid syntax
>>> print "hello"
SyntaxError: invalid syntax
>>> printf ("hello")
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    printf ("hello")
NameError: name 'printf' is not defined
>>> printf 'hello'
SyntaxError: invalid syntax
>>> printf ('hello')
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    printf ('hello')
NameError: name 'printf' is not defined
>>> printf("hello")
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    printf("hello")
NameError: name 'printf' is not defined
>>> printf 5
SyntaxError: invalid syntax
>>> print ("hello")
hello
>>> print (5)
5

>>> 

版本與教程不一致