I. Python Basics

Source: Internet
Author: User
Tags naming convention

One. The origins of Python

 Python is an explanatory weak-type programming language. 
Features: Simple. Clear. Elegant

Two. The Python interpreter
CPython. is provided by the official. Internal use of the C language to implement
PyPy. To interpret our code as a bytecode file at once. You can run it directly.

Three. The first Python program
Print (any content)

Four. Variable
The intermediate value produced during the run of the program. Temporarily saved in memory. For subsequent programs to use the
naming convention:
1. Use letters, numbers, underscores
2. Cannot start with a number, not a pure number
3. You cannot use the Python keyword
4. Don't be too long
5.
6. Case Sensitive
7. Do not use Chinese
8. It is recommended to use the hump or Underline


Five. The data type of the variable
1. int. Integer. You can do +,-, *,/,%,//
2. str. String. can be + *
3. bool. A Boolean value. Two values. True, False
Six. User interaction
Variable = input (Prompt)
received is the string type
str = > int = int (str)
Seven. Process Control (IF)
If condition:
code block

If condition 1:
code block 1
Else:
code block 2

If condition 1: br> code block
elif Condition 2:
code block
Elif ....
Else:


If condition:
If condition:
If condition:
code block
Else:
else:

---restore content ends---

I. Python Basics

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.