Understanding and Understanding Python

Source: Internet
Author: User

One: Python introduction
1.1 Python founder Guido Van Rossum (Uncle Tortoise) was developed in 1989. Python is beautiful, clear and simple.
1.2 Python is an interpreted language, which belongs to the weakly typed language.
1.3 Advantages:
1. Elegant, clear and simple
2. High development rate
3. Portability, extensibility, embedded type
Disadvantages:
1. Slow speed,
2. Code cannot be encrypted
3. Threads cannot take advantage of multi-CPU issues
1.4 Python Interpreter
Cpython,ipython,pyy,jpython,ironpython
1.5 Python history
1991, the first Python compiler was born.
2008 python2.0 Update the same year python3.0 update (reason: 1.python2.0 too complex, not in line with the development concept
2.python2.0 cannot be used in Chinese, Solution #-*-encoding:utf-8-*-)


Variable: The result of the operation is staged into memory for subsequent use.
1. Consists of numbers, letters, underscores
2. Cannot be the beginning of a number, not a pure number
3. Cannot be a keyword in python
4. To distinguish case
5. Not too often
6. To make sense
7. Do not use Chinese
8. Recommended hump, Glide line Name
Hump (first letter capital other than the first letter of each word capitalized)
Underline (separated by _ between each word)

Note: Single-line comments with #
Multi-line comment with "' annotated content '," "" Annotated Content ""


Basic types of Python:
1.int (integer) can be +-*/
2.str (String) can be + (splicing) * (repeat)
. BOOL (Boolean) True and False


User interaction: Input ("prompt")
User content can be entered directly


If statement
Syntax 1
If condition:
code block
Else
code block


Syntax 2
If condition:
code block
Elif
code block
Else
code block

Nesting


If condition:
Results 1
If condition 2:
Results 2
else:
Results 3
else:
code block

Understanding and Understanding Python

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.