python基础学习:
参考网址:https://www.liaoxuefeng.com/wiki/1016959663602400/1017032074151456
知识点:
1、python3 input()函数
第一次输入name = input() 输入Michael 报错如下:
Traceback (most recent call last):
File "", line 1, in
File "", line 1, in
NameError: name 'Michael' is not defined
报错原因:Python3.x 中 input() 函数接受一个标准输入数据,返回为 string 类型
因为输入的是Michael没有添加单引号或者双引号。当然可以是int
eg:
>>> a = input("input :")
input :123
>>> type(a)
<type 'int'>













网友评论