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 ...
随机推荐
- 【转】AWK常用
awk是个优秀文本处理工具,可以说是一门程序设计语言.下面是awk内置变量. 一.内置变量表 属性 说明 $0 当前记录(作为单个变量) $1~$n 当前记录的第n个字段,字段间由FS分隔 FS 输入 ...
- python之在线平台与量化投资
0. 第一个量化策略 # 初始化函数,设定基准等等 def initialize(context): set_benchmark('000300.XSHG') g.security = get_ind ...
- Technical debt
What is Technial debt? Technical debt is not bug. It is that the feature can work, but it is not a p ...
- PHP 第3方评论系统
这段时间,无觅 评论也下线不能使用了. 客户好几个网站使用了.无觅 评论,前面也是用的是多说还是什么,总之也是第3方评论,没想到没过多久,又停止使用了. 没办法,网站还是需要评论系统,一气之下,自己做 ...
- java类加载时执行顺序
源代码 class HelloA { public HelloA() { System.out.print("A"); } { System.out.print("B&q ...
- node-glob的*匹配
目录结构 src/js/libs/app.js src/js/index.js 测试脚本 var glob = require('glob') glob('', {}, function (err, ...
- python中的协程及实现
1.协程的概念: 协程是一种用户态的轻量级线程.协程拥有自己的寄存器上下文和栈. 协程调度切换时,将寄存器上下文和栈保存到其他地方,在切换回来的时候,恢复先前保存的寄存器上下文和栈. 因此,协程能保留 ...
- HDU 3944 DP? [Lucas定理 诡异的预处理]
DP? Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 128000/128000 K (Java/Others)Total Subm ...
- ThinkPHP删除栏目(多)
前段时间发表了一个删除栏目的随笔,当时实现的功能是删除一条信息,这次来实现一下批量删除栏目. 我们需要达到的是这样一个效果: 选中批量删除按钮后可以选中所有该页面的栏目,这个是前端页面的实现,在这里就 ...
- 借腾讯开源 VasDolly,谈谈 Android 签名和多渠道打包的原理!
一.前言 Hi,大家好,我是承香墨影! 当我们需要发布一款 App 到应用市场的时候,一般需要我们针对不同的市场生产不同的渠道包,它们使用的是同一套代码,只是会包含一些各自的渠道信息,用于我们做数据分 ...