Python Learning notes (i)

Source: Internet
Author: User

Previously, I learned about C + +, after the first contact with Python, there is a similar concept of hate, recently began to contact Python, is reading a concise Python tutorial, encountered Python's own grammatical characteristics. indentation in Python represents a block in Python, and indentation is important;Python is case-sensitive;In python, the end of a (colon) indicates that the next line opens a block;

1, python operator: * * To return x to the Y-square;//Take the integer portion of the returned quotient

Control if and for (no swich) break continue, can take an else block

The function (1) assigns a value to the function outside of the function, declares the variable globally, and global varname

(2) Key parameters use function name (key parameter) instead of variable position to assign parameter position to function

(3) pass represents an empty block, function has no entity, and pass represents an empty block

Dosstrings is enclosed in "" "(three quotation marks), the first line begins with a full stop, the second behaves as a blank line, the third behavior interprets the body of the string (cannot appear in Chinese), and the first line begins at the function block.

The __doc__ call is printed with the object's function name, and the Help () is a dosstrings.

Python Learning notes (i)

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.