Getting Started with Python

Source: Internet
Author: User

---restore content starts---

Python is an object-oriented, interpreted computer programming language, invented by Dutchman Guido van Rossum in 1989, and the first public release was released in 1991.

Python has a rich and powerful library. It is often nicknamed the glue language and is able to easily connect a variety of modules made in other languages, especially in C + +.

Below I am a few of my beginner's knowledge points:

The most distinctive feature of 0:python is the use of indentation to represent blocks of code, without the use of curly braces {}.

1. Variables: No need to define keywords, such as x=10;

2. Notes: A single-line comment in Python begins with # , multiple lines of comments can be in several # numbers, and "and" " :

3.print The default output is line-wrapping, if you want to implement no line-wrapping need to add end= ""at the end of the variable:

4. Standard data type:

There are six standard data types in the Python3:

    • Number (numeric)
    • String (String)
    • List (lists)
    • Tuple (tuple)
    • Sets (collection)
    • Dictionary (dictionary)

Among the six standard data types of Python3:

    • immutable Data (four): Number (numeric), string (string), tuple (tuple), sets (set);
    • variable data (two): List, Dictionary (dictionary).

5. Variable Assignment:

A=b=c=1 indicates that three variables are assigned the same value

a,b=1,2 indicates that A and B are assigned values of 1 and 2 respectively.

6. Two methods of judging data types:

Type () does not consider a subclass to be a type of parent class

Isinstance () is considered a subclass of a type of parent class

7,string type slices:

Print (Str[ind,ind,step])-----ind refers to the corresponding subscript, step

8, condition control

If elif Else

9, loop

(1) While  judging condition:     code block
(2) for X in range (A, B)

---restore content ends---

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.