调用Python的print函数出问题
来源:互联网 发布:mac 命令行卸载软件 编辑:程序博客网 时间:2024/05/21 10:29
想尝试一下Python中的最简单的输入:print函数的用法lzzh@lzzh-VirtualBox:~/Desktop$ vim test.py
然后在test.py中输入以下命令:
password = raw_input("Please input the PASSWORD:")print 'The password you have inputed is ',password
保存后运行出现这个问题:
如图:显示语法错误,在调用print函数时没有括号,于是改为用如下命令运行:
lzzh@lzzh-VirtualBox:~/Desktop$ python test.py
可行!
结果如下:
Please input the PASSWORD:fafafafaThe password you have inputed is fafafafa
总结:
1. 使用Python2版本时print函数可以不使用括号括起来,
2. Python3 版本对print函数进行了更改,其要求用括号()将要输出的内容进行括入。
阅读全文
0 0
- 调用Python的print函数出问题
- Python的print函数
- python的print函数的一些功能
- Python的input(),print()函数问题
- Python的安装设置及print函数
- Python print函数用法
- Python Print函数用法
- Python Print函数用法
- python print函数
- Python-print函数用法
- Python print函数
- Python Print函数学习
- Python print() 函数
- python print函数
- Python print()函数
- Python print函数用法,print 格式化输出
- Python print函数用法,print 格式化输出
- Python print函数用法,print 格式化输出
- Android:如何快速对系统重启问题进行归类
- 一般线性模型、混合线性模型、广义线性模型
- 解决ueditor百度富文本编辑器图片可以上传但是在线管理图片无法显示
- jmeter与session(2)
- 乐曲创作
- 调用Python的print函数出问题
- 淘宝开店考试试题以及50题答案
- String—增删查改
- Lua 运算符
- CodeFroces 827A.String Reconstruction
- 基础java面试题梳理
- linux上gcc编译问题---math库函数
- C++ new的三种用法详细解析
- 优秀的有趣的博客