python2和3的区别

时间:2023-02-04 15:29:24

1. 
  2 print 'aaa' 3 print('aaa')
2.    消除每个print语句自动打印的换行符
  2 print 'aaa', 3 print('aaa',end='')
3   Python3以后删除了has_key()方法! if key1 in adict:
4    2 raw_input 3 input
5   2 file 3 open
6   python2有cPickle,但是在python3下,是没有cPickle的
7   异常 2 ShortInputException, x: 3 except ShortInputException as x:

未完待续