第五章 py2和py3在使用过程中的一个很大的差别

1. 在python3中只有一个input:
特点:会用户输入的任意内容都存成str类型
 x=input('>>>: ') #x='123123123'
 print(type(x))
salary=input('>>: ') #salary='3000'
salary=int(salary)
print(salary * 12) #
 
 
2. 在python3中只有一个raw_input,与python3的input一模一样
x=raw_input('>>>: ')
要求用户必须输入一个明确的类型,输入什么类型就存成什么类型
x=input('>>>: ')
原文地址:https://www.cnblogs.com/martin-wang/p/9985379.html