Python2与Python3的区别
Python2与Python3的区别
Python2 | Python3 | |
---|---|---|
print 'hello world' | print('hello world') | |
源码不统一 | 源码统一 | |
有重复代码 | 没有重复代码 | |
整型的除法结果 | 整形 | 浮点型 |
input() | 输入什么类型就是什么类型 | 获取的都是字符串类型 |
raw_input() 获取到的都是字符串类型 |
Python2 | Python3 | |
---|---|---|
print 'hello world' | print('hello world') | |
源码不统一 | 源码统一 | |
有重复代码 | 没有重复代码 | |
整型的除法结果 | 整形 | 浮点型 |
input() | 输入什么类型就是什么类型 | 获取的都是字符串类型 |
raw_input() 获取到的都是字符串类型 |