菜鸟教程 Missing parentheses in call to 'print'
个人博客 地址:http://www.wenhaofan.com/article/20180618180327
>>> print "hello" SyntaxError: Missing parentheses in call to 'print'
在环境搭建章节中的路径下载了最新的Python安装包并完成安装后,在cmd窗口执行菜鸟教程第一个 Python 程序中的代码:print "Hello, Python!";提示“>>> print "hello" SyntaxError: Missing parentheses in call to 'print'” 。
原因为该教程实例基于python2.7版本,但是python官网最新的版本已经为3.x。而在python3.x中已经取消了print语句,加入了print()函数来执行输出。
所以在3.x版本中打印Hello,Python应该由print “Hello,Python”; 修改为 print (“Hello,Python”);
菜鸟教程 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'
C:\Users\konglb>python Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (I ...
- 【PYTHON】 Missing parentheses in call to 'print'
Microsoft Windows [版本 10.0.15063] (c) 2017 Microsoft Corporation.保留所有权利. C:\Users\Jam>python Pyth ...
- SyntaxError: Missing parentheses in call to 'print' 这个错误原因是Python版本问题
问题 print "www.baidu.com" Python2 print ("www.baidu.com") Python3 出 ...
- Python3.x运行Python2.x代码报错 syntax error "Missing parentheses in call to 'print'
#另外一种错误 SyntaxError: Missing parentheses in call to 'print'. Did you mean print( 查看代码,格式如下: print &q ...
- 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中 ...
- Missing parentheses in call to 'print'
这个消息的意思是你正在试图用python3.x来运行一个只用于python2.x版本的python脚本. print"Hello world" 上面的语法在python3中是错误的 ...
- 【python系列】SyntaxError:Missing parentheses in call to 'print'
打印python2和python3的区别 如上图所示,我的 PyCharm安装的是python3.6如果使用print 10会出现语法错误,这是python2.x和python3.x的区别所导致的.
随机推荐
- 常见Linux命令学习
Linux命令学习 命令分类: 文件处理命令 权限管理命令 文件搜索命令 帮助命令 用户管理命令 压缩解压命令 网络命令 关机重启命令 1.文件处理命令 命令格式:命令 [-选项] [参数] 例:ls ...
- vue-socket.io跨域问题的解决方法
报错信息: Access to XMLHttpRequest at 'http://192.168.37.130:5050/socket.io/?EIO=3&transport=polling ...
- 《手把手教你构建自己的 Linux 系统》学习笔记(10)
目录 /etc/fstab 文件的作用是什么? Linux 内核的图形化启动是怎么回事? Linux 系统中的文件名是否以大小写来进行区别? 「GRUB 中无法找到硬盘」怎么解决? 「GRUB 及配置 ...
- 五种编程语言解释数据结构与算法——顺序表2(java与C++语言实现)
5.java实现方式: 5.1.顺序表的抽象结构 package com.xgp.顺序表; public interface MyList<T> { //1. initList(& ...
- elsearch搜索引擎 + painless脚本语言入门
最近项目用到了elsearch,ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎. 自从版本6.0之后,其默认脚本语言变为 painless . ...
- MySql -- check 约束
6.CHECK 约束:用于限制列中的值的范围 在一些情况下,我们需要字段在指定范围的输入,例如:性别只能输入 '男'或者'女',余额只能大于0等条件,我们除了在程序上控制以外,我们还能使用 CHECK ...
- Linux中为什么执行自己的程序要在前面加./
前言 在Linux中,我们执行内置命令时,直接输入命令名称即可,如: $ mv a b #将a重命名为b 而在执行自己写好的程序时,却要带上./,例如: $ hello hello: comm ...
- 取Cookie值
string url_Login_Group = "http://ui.ptlogin2.qq.com/cgi-bin/login?appid=549000912&daid=5&am ...
- 885.求组合数 I(模板)
O(n^2) 数据范围 a*b =4e6 根据组合数公式: 代码: import java.util.Scanner; public class Main{ static final int N=2 ...
- 牛客寒假训练营2-C算概率
思路 用 f(i,j) 来表示当前做了i道题,共做对了j道题 状态 f[i][j] = f[i-1][j] * (1-p[i]) + f[i-1][j-1] * p[i] 第一种:由于i-1时对了j题 ...