python3与python2的区别

1、print

    python2:   print a

    python3:   print(a)

2、字符串计数

    python2:   count(str,sub)

    python3:   str.count(sub)

3、unicode

    python2:   str是str,unicode是unicode

    python3:    str是unicode

4、raw_input

    python2:   raw_input()

    python3:    input()

你可能感兴趣的:(python3与python2的区别)