菜鸟教程 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的区别所导致的.
随机推荐
- opencv —— findContours、drawContours 寻找并绘制轮廓
轮廓图像与 Canny 图像的区别 一个轮廓一般对应一系列的点,也就是图像中的一条曲线.轮廓图像和 Canny 图像乍看起来表现几乎是一致的,但其实组成两者的数据结构差别很大: Canny 边缘图像是 ...
- PythonI/O进阶学习笔记_10.python的多线程
content: 1. python的GIL 2. 多线程编程简单示例 3. 线程间的通信 4. 线程池 5. threadpool Future 源码分析 ================== ...
- 《手把手教你构建自己的 Linux 系统》学习笔记(2)
Linux 系统定制原理 虚拟根目录 我们的目标是为了完成目标系统(也就是我们要做的系统),他是一个可以独立运行的系统,不依赖雨主系统和临时系统,根据 Linux 系统的特点它需要存放在根目录下面,但 ...
- 剑指offer-面试题61-扑克牌中的顺子-数组
/* 题目: 从扑克牌中随机抽取n个数字,判断他们是否连续,扑克牌从A~K,大小王可代替任意数字. */ #include<iostream> #include<cstdlib> ...
- PHP-CMS代码审计(4)
这次找了个发卡平台,url: https://files.cnblogs.com/files/b1gstar/kamiphp.zip 从52破解上下载的 : 先把网站搭建起来. 网站没有采用mvc框 ...
- MySQL 当记录不存在时插入(insert if not exists、dual )
INSERT INTO clients(client_id, client_name, client_type)SELECT 10345, ’IBM’, ’advertising’FROM dualW ...
- Android中创建一个BroadcastReceiver
首先创建一个java类继承BroadcastReceiver类 package com.example.service; import android.content.BroadcastReceive ...
- 网络流最大流——dinic算法
前言 网络流问题是一个很深奥的问题,对应也有许多很优秀的算法.但是本文只会讲述dinic算法 最近写了好多网络流的题目,想想看还是写一篇来总结一下网络流和dinic算法以免以后自己忘了... 网络流问 ...
- c#日期时间段判断
select * from 表名 where (case when ISDATE(字段名)=1 then CONVERT(varchar(100),cast(字段名 as datetime),23) ...
- Python的入门级试用(简明教程)
声明:借鉴Python 简明教程 用 Python 编写的传统的 'Hello World' 程序.使用 Python 运行你的程序的方法有两种:使用交互式解释器提示符或者使用源文件.现在我们来看一下 ...