Python Basics - The introduction of annotations
Classification of notes :
<1> Single-line comments : With # start ,# All the text on the right serves as a description , It's not really a program to execute , To assist in explaining
Multiline comments use three single quotes ‘’’ Or three double quotes “”" Enclose the notes , for example :
1、 Single quotation marks （’’’）
2、 Double quotes （"""）
notes ： In program code, the text that explains the program code .
effect ： Comments are not programs , Cannot be executed , Just explain the program code , The program can make other people understand the code , Can greatly enhance the readability of the program .
The type of variable ：
Python Basics - Variables and types
What is a variable ？
Variables , It can be understood as a basket of vegetables , If you need to store multiple data , The easiest way is to have multiple variables , Of course, you can also use a
The program is used to process data , Variables are used to store data
How to know the type of a variable ？
stay python in , Just define a variable , And it has data , Then its type has been determined , We don't need developers to actively explain its type , The system will automatically identify
have access to type( The name of the variable ), To see the types of variables ：print(type(num1)
Numbers (Number) type
python There are four types of middle numbers ： Integers 、 Boolean type 、 Floating point and complex number .
int ( Integers ), Such as 1, There is only one integer type int, Expressed as a long integer , No, python2 Medium Long.
bool ( Boolean ), Such as True.
float ( Floating point numbers ), Such as 1.23、3E-2
complex ( The plural ), Such as 1 + 2a、 1.1 + 2.2b
If you want to learn how to program, you can make it up Q Group 768671345, You can get free learning materials when you join the group , And the boss will answer your questions