1. Environment building and Config 2. Variable and data type data types, floating-point numbers (1.2e3,1.3e-2), Strings ("", "'," ' ") (' i\ ' m \" ok\ "! ') \ \ r ' ASDFASFA ' \ n ' ' ADSADF '
Boolean Boolean values are exactly the same as Boolean algebra, with a Boolean value of only true, false two, or true, or false, in Python, which can be used to indicate a Boolean value directly with True, false (note case), or by Boolean operations: Boolean values can be operated with and, or, and not.
Null null value is a special value in Python, denoted by none. None cannot be understood as 0, because 0 is meaningful, and none is a special null value.
In addition, Python provides a variety of data types such as lists, dictionaries, and also allows you to create custom data types, which we'll continue to talk about later.
The concept of variable variables is basically the same as the equation variables in junior algebra, but in computer programs, variables can be not only numbers, but also arbitrary data types.
Variables are represented by a variable name in the program, and the variable name must be a combination of uppercase and lowercase English, numeric, and _, and cannot start with a number, such as:
Arbitrary data types can be assigned to variables, the same variable can be repeatedly assigned, and can be different types of variables, such as:
A = 123 # A is an integer print (a) a = ' ABC ' # A becomes a string print (a)
/division evaluates to a floating-point number, even if two integers are evenly divisible, the result is also a floating point number: >>> 9/3 3.0
There is also a division is//, called the floor except, the division of two integers is still an integer:
>>> 10//3 3
Python data type