我是Python的新手,我试图声明一个变量并打印它的值。python中的可变打印
这是我的代码:
#!C:\Python32\python.exe
import sys
import os
import cgi
import cgitb
cgitb.enable()
a = 5
print(a)-------------------------> My doubt is in this line
但是我的一个朋友写道行print a
。在他的Python中,它正在打印该值,但在我的情况下,它显示为“无效语法”。这是为什么发生?
读[最新消息在Python 3.0](http://docs.python.org/release/3.0.1/whatsnew/3.0.html#print-is-a-function) –