The difference between python2.x and python3.x

1. The difference between raw_input() and input() in python2.x and python3.x

1、 In Python2.x, raw_input() and input( ), both functions exist, the difference is

raw_input( )--- treat all input as string and return the string type

input( )-----can only receive "digital" input, has its own characteristics when treating pure digital input, it returns the type of the input number (int, float)

  1. In python3.x, raw_input() and input() are integrated, raw_input() is removed, and only the input( )** function is retained, which accepts arbitrary input and defaults all inputs For string processing, and return the string type.

Recommended Posts

The difference between python2.x and python3.x
The difference between CentOS 7 and CentOS 6
The difference between CentOS and Ubuntu
The difference and connection between Centos and Redhat
The difference between the syntax of java and python
What is the difference between python and pycharm
The difference between Python extensions
What is the difference between synchronous and asynchronous Python?
A brief summary of the difference between Python2 and Python3
The difference between CentOS and Ubuntu in Linux system
First understanding of the difference between centos7 and centos6 (kernel, commands, etc.)
What is the difference between a python script and a web page
The relationship between Open3D version and Ubuntu
Summary: Ubuntu Python2.x and