"Learn Python with Me" Python Learning Summary

Source: Internet
Author: User

Start Jing, nu push an article: yards farmers should pay attention to the office etiquette

Learning a scripting language is necessary, and when we develop some simple, fast programs, the scripting language comes into play, and it's very helpful.
Python is a very simple and powerful language, according to Python. And it's object-oriented. The Pthon can be extended by C.
Tutorials for Python
Http://linux.chinaitlab.com/manual/Python_chinese/index.html

1. Python has only 4 types of numbers-integers, long integers, floating-point numbers, and complex numbers.
2. String
Single quotes and double quotes all work as a string
Three quotation marks ("' or" ") indicate a string of multiple lines
3. Variable naming rules characters, underscores, and numbers, but cannot start with a number and is case sensitive.
4. Semicolons represent the end of a logical line/statement. This is the same as Java, but the best practice is that a physical line is best a logical line, with as few semicolons as possible. Split with \ If you want to represent a logical line in multiple physical rows
5. Whitespace is important in python. In fact the gap at the beginning of the line is important. It is called indentation. Whitespace (spaces and tabs) at the beginning of a logical line is used to determine the indentation level of logical lines, which is used to determine the grouping of statements. This means that statements at the same level must have the same indentation. Each set of such statements is called a block.

(Note: In Python, the code needs to start with the first column, not a space, so that the main statement block, when a separate hierarchy is required, with a colon: that is, the next line of the colon begins with another statement block, the first line of the same statement block must be the same space. Similar to the effect of curly braces in Java)
Functions of 6.python

Definition: keyword def function name ():

Like what

def  sayHello ():
    print ‘Hello World!‘ # block belonging to the function

The use of functions is similar to Java, but there are differences, such as the default value of the parameter, the default value of the parameter must be placed at the end, SayHello (x,y=4). If there are many parameters, we can use "key parameters" to assign values to the parameters. This means that you can assign values based on the parameter name, such as SayHello (A,b,c), and you can use SayHello (c=4,b=2,a=10) when calling.

Recommended Python3 Tutorials

Http://woodpecker.org.cn/diveintopython3/index.html

"Learn Python with Me" Python Learning Summary

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.