Getting to know the python version

  1. Difference one:  
    • python2x: The community is open to absorb the source code improvement functions of various great gods, resulting in non-standard source code, too much confusion and too much repetitive code .
    • python3x: Guido Van Rossum (the founder of Uncle Turtle) reorganized and standardized the source code in order to meet the goals of " elegance", "clearness" and "simpleness " .
  2. Difference two:  
    • python2x: The default encoding method ascii, the first line to display Chinese needs to be added: # -*- encoding: utf-8 -*- .
    • python3x: The default encoding is utf-8.
  3. Difference three:  
    • python2x: print 'content' print('content').
    • python3x: print('content').
  4. Difference four:  
    • python2x: raw_input(); input() is equivalent to eval().
    • python3x:input()。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324938656&siteId=291194637