SyntaxError: Missing parentheses in call to 'print'
C:\Users\konglb>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'hello, python world';
File "<stdin>", line 1
print 'hello, python world';
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('hello,
python world';)?
其实这个错误信息,是因为Python3中取消了以前Python 2中的语法,两者在打印输出的语法上有所差别,所以在Python 3下面使用之前的语法格式就会报错,错误信息已经提示你需要加上括号,字符串可以用单引号或双引号括起来,正确语法格式如下所示:
C:\Users\konglb>python -V
Python 3.6.3
>>> print ('hello,python world')
hello,python world
>>> print("you are right")
you are right
>>>
SyntaxError: Missing parentheses in call to 'print'的更多相关文章
- python 错误之SyntaxError: Missing parentheses in call to 'print'
		SyntaxError: Missing parentheses in call to 'print' 由于python的版本差异,造成的错误. python2: print "hello ... 
- SyntaxError: Missing parentheses in call to 'print'  这个错误原因是Python版本问题
		问题 print "www.baidu.com" Python2 print ("www.baidu.com") Python3 出 ... 
- Python SyntaxError: Missing parentheses in call to 'print'
		下面的代码 print "hello world" 会出现下面的错误 SyntaxError: Missing parentheses in call to 'print' 因为写 ... 
- 错误:SyntaxError: Missing parentheses in call to 'print'
		1.Python3编译器使用print函数需加括弧 print(XXX) 而Python 2可以print XXX 2.Python3表示不等只能用"!=" 3.在python3中 ... 
- 【python系列】SyntaxError:Missing parentheses in call to 'print'
		打印python2和python3的区别 如上图所示,我的 PyCharm安装的是python3.6如果使用print 10会出现语法错误,这是python2.x和python3.x的区别所导致的. 
- >>> print "hello" SyntaxError: Missing parentheses in call to 'print'
		错误原因说你的函数print缺省圆括号,可以知道你用的python是3.x版本3.x版本的python,print中的参数要用圆括号括起来,改成:print("hello") 
- 解决python 提示 SyntaxError: Missing parentheses in call to 'print'
		刚刚学习python,练习他的输出,发现输出一个常量时报错了,如下: 发现是因为python2.X版本与python3.X版本输出方式不同造成的在python3.X的,输入内容时都要带上括号pytho ... 
- SyntaxError: Missing parentheses in call to 'print'. Did you mean print('XXXXXX')?
		因为Python3中取消了以前Python 2中的语法. 所以Python 3再使用python2的语法格式就会报错 错误信息中提示需要加上括号,字符串可以用单引号或双引号括起来 这样就不会报错了. 
- 【PYTHON】 Missing parentheses in call to 'print'
		Microsoft Windows [版本 10.0.15063] (c) 2017 Microsoft Corporation.保留所有权利. C:\Users\Jam>python Pyth ... 
随机推荐
- Linux命令:useradd
			Linux下:useradd 等价于 adduser Aix下:useradd 来自为知笔记(Wiz) 
- 统一网络控制器Func
			一.简介 二.安装 三.测试 一.简介 什么是Func? Func是由红帽子公司以Fedora平台构建的统一网络控制器,是为解决集群管理.监控问题而设计开发的系统管理基础框架.它是一个能有效简化多服务 ... 
- traffic server文件目录
			功能: Trafficserver的主要功能是缓存,当然你也可以用它来做纯粹的反向代理(像通常用nginx那样).通常切入一个庞大的系统的最好方式是看如何使用,使用traffic server的主要入 ... 
- Codeforces B. Divisiblity of Differences
			B. Divisiblity of Differences time limit per test 1 second memory limit per test 512 megabytes input ... 
- eclipse修改默认workspace
			1.进入 Window > Preferences > General > Startup and Shutdown 选中 Prompt for workspace on start ... 
- 通过重写 class 的 ToString() 来简化获取 enum 的 DescriptionAttribute 值
			通过重写 class 的 ToString() 来简化获取 enum 的 DescriptionAttribute 值 目录 一.常见的 enum 类型 二.演变:class 版本的 enum 类型 ... 
- 吴恩达深度学习笔记(deeplearning.ai)之卷积神经网络(二)
			经典网络 LeNet-5 AlexNet VGG Ng介绍了上述三个在计算机视觉中的经典网络.网络深度逐渐增加,训练的参数数量也骤增.AlexNet大约6000万参数,VGG大约上亿参数. 从中我们可 ... 
- 代理(Proxy)模式
			代理模式的类图如下所示: 客户端想调用的是RealSubject,由于某种考虑或原因,只能直接访问到ProxySubject,再由ProxySubject去调用RealSubject,这就完成了一次代 ... 
- make和makefile简明基础
			0.make.makefile是什么? makefile定义了一系列的规则,来规定哪些部分先编译,哪些部分后编译,写好makefile以后,只需一个make命令就可以让整个工程完全自动编译,所以简单的 ... 
- bzoj 2627: JZPKIL [伯努利数 Pollard-rho]
			2627: JZPKIL 题意:求 \[ \sum_{i=1}^n (n,i)^x [i,n]^y,\ [i,n] = lcm(i,n) \] \(n \le 10^{18},\ x,y\le 300 ... 
