python 第一步

来源:互联网 发布:javascript中关键字 编辑:程序博客网 时间:2024/06/05 18:10
>>> 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

>>> 

版本与教程不一致

0 0