美文网首页
Python 学习笔记

Python 学习笔记

作者: 詩禮傳家 | 来源:发表于2017-07-28 10:18 被阅读0次

Programming for Everybody (Python)

1. 视频 2.2

从键盘获取输入,视频中讲的是

nam = input('who are you?')
print('hello', nam)

在python2.7中提示 "nam not defined" 错误。
一种解决方式是输入 " *** ";
另一种是采用如下的命令:

nam = raw_input('who are you?')
print 'hello', nam

相关文章

网友评论

      本文标题:Python 学习笔记

      本文链接:https://www.haomeiwen.com/subject/whsxlxtx.html