Python2.X使用raw_input()
Python3.X废弃了raw_input()函数,使用input()函数替代它
code:
1 data=input("please input a data:") 2 print(data) 3 print(type(data))
运行结果:
please input a data:5
5
<class 'str'>
Python2.X使用raw_input()
Python3.X废弃了raw_input()函数,使用input()函数替代它
code:
1 data=input("please input a data:") 2 print(data) 3 print(type(data))
运行结果:
please input a data:5
5
<class 'str'>