python-basics-basics-variables-select-loop

1 Basic knowledge

1.1 Classification of annotations

 

1.2 Variables and Types

  Variable definitions

    num1 = 100 #num1就是一个变量,就好一个小菜篮子

    num2 = 87  #num2也是一个变量

    result = num1 + num2 #把num1和num2这两个"菜篮子"中的数据进行累加,然后放到 result变量中

   variable type

  

Note: How do you know the type of a variable?

    • In python, as long as a variable is defined and it has data, its type is already determined, and we do not need our developers to actively explain its type, the system will automatically identify it
    • You can use type (the name of the variable) to see the type of the variable


1.3 Input and output

output

  normal output

  

  # print hint
    print('hello world')
    print( ' Give me the card---Hindi, hello ' )
格式化输出


  

enter

1.4 Operators and data type conversions

 

2 Selection and judgment

2.1 Selection

 

 

2.2 Cycle

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325113112&siteId=291194637