Data type:
Integers: integers, including positive integers, 0, negative integers
Floating point: In layman's words, it's a decimal.
Long integers: A long integer, usually followed by an L-
String: The string needs to be enclosed in "or". Single and double quotes can appear simultaneously, such as "I ' m jake!"
Boolean value: Only two True, False
Null: denoted by none, but not the same as 0. Since 0 is also a value, it is not empty.
Do you see the difference?
Variable:
Variable: consists of letters, numbers, and underscores, but cannot begin with a number. such as a, _a, A7 These are legal, 7a this is illegal.
When naming variables, there are usually several principles:
1. Cannot use keyword as variable name
2. The variable name is as explicit as possible, that is, to indicate the meaning of the variable, such as Age = 12, a
3. If the variable has more than one word, connect it with an underscore, such as My_name
4. The above variables can also capitalize the first letter of the word, such as MyName
Assignment of variables:
For example, age = 12, this completes the assignment. If it's a string, use quotation marks like name = ' Jack '
Python (day1)-data types and variables