Python3 coding differences

https://cv-tricks.com/how-to/developer-guide-to-key-differences-between-python-2-and-3/

 

    • Print Statement
    • input() function (returns a string in 3.x; under 2.x use raw_input instead)
    • Unicode Literals
    • Exceptions
    • Rounding
    • List comprehension
    • Generators
    • string.replace is not available anymore
    • reload() should be replaced with import importlib; importlib.reload()
    • As of Python version 3.7, dictionaries are ordered. In Python 3.6 and earlier, dictionaries are unordered but insertion ordered.

 

Share: