input只能输入数字

raw_input 既可以输入数字也可以输入字符串

>>> input("input you name:")
input you name:carrie
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
NameError: name 'carrie' is not defined


>>> input("input you name:") input you name:11 11
>>> raw_input("input you name:") input you name:carrie 'carrie'
>>> raw_input("input you name:") input you name:11 '11'

 

posted on 2018-08-22 14:30  宅女士  阅读(139)  评论(0编辑  收藏  举报