python-Basics-Basics-variables-selection-loops

Source: Internet
Author: User

1 Basic Knowledge 1.1 Classification of annotations

1.2 Variables and types

  Variable definition

    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, then its type is determined, without the developer's initiative to explain its type, the system will automatically identify
      • You can use the type (the name of the variable) to see the type of the variable

1.3 Inputs and outputs

Output

  Normal output

  

  # Print prompt    ('helloworld') print    ('  Give me the card---hindi, you mean ')
格式化输出


  

Input

1.4 Operator and data type conversions

2 selection and Judgment 2.1 selection

2.2 Cycles

python-Basics-Basics-variables-selection-loops

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.