Getting Started with Python

Source: Internet
Author: User

  1. Python positioning
  2. Variable
  3. User-to-program interaction
  4. Basic data types
  5. Formatted output
  6. Basic operators
  7. if...else of Process Control
  8. Process Control while loop
  9. Process Control for loop
  10. Extended Reading
  11. Homework

Python positioning:

# High-level language: Standing in the Human (slave) angle, speaking, that is, using human characters to write programs, shielding the operation of the hardware.  # explanatory type (interpreter required, equivalent to simultaneous interpretation): such as python, slow execution, easy debugging. 

Variable:

How to define variables:

# variable name (equivalent to house number, the space to which the value is located), equal sign, variable value name='guoxq'age =18

Definition Specification for variables:

# 1. Variable names can only be any combination of letters, numbers, or underscores #2. The first character of a variable name cannot be a number #3. The keyword cannot be declared as a variable name [' and ', ' as ', '  Assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ', ' for ', ' from ', ' global ', ' If ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' Try ', ' and ', ' with ', ' yield ']
    

How to define:

# underline (recommended)AGE_OF_GUOXQ =80

Defined variables are: id,type,value

#the 1 equals sign compares value,#2 is the ID of the comparison#emphasize:#1. Same ID, meaning the type and value must be the same#2. Value the same type must be the same, but the ID may be different, as follows>>> x='Info guoxq:18'>>> y='Info guoxq:18'>>>ID (x)4376607152>>>ID (y)4376607408>>> >>> x = =ytrue>>> x isYfalse

Getting Started with Python

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.