The previous section describes the installation of the Python environment, a section that writes variables and names.
Python is written in C, so a lot of C's ideas are inside.
The basic data types are shaping, floating point, and character type.
Shaping int
Float type float
Character Type Str
Continue to open the tool IDLE,
Enter the type (3) on the interactive interface, press ENTER, type (3.0), press ENTER, type (' 3 '), and press ENTER. The result is the same as in Python, with single quotation marks (') and double quotation marks (""). The next use of variable A = 1 means that we define a variable a, and the value 1 is assigned to a, this time a is the type of a = ' 1 ' means that we define a variable a, and the character value ' 1 ' is assigned to a, this time a is the type of a character type such a child-defined variable is usually inside the function, There is no indication of the meaning of this variable. Here's an interesting example:
1 # 100M of broadband at home, calculate the actual speed 2 Bandwidth = 100/83 print'M')
# Start with a comment, can write casually, record the inspiration at the time, will not have an impact on the actual code
A variable bandwidth is defined to denote the meaning of the bandwidth; the print () function can output the data we want to see. A variable name can start with a letter, or it can begin with an underscore, not a number. Variable names can contain numeric letters and underscores.
Bandwidth = 100/8 The meaning of this sentence 100 divided by 8, 12.5, the floating-point number 12.5 is assigned to the variable bandwidth
Variables and variables can also be assigned to each other, such as:
The value of a=1 B=a # B is 1
Pupils learn Python (ii)