Python Coding specification

Source: Internet
Author: User

Today's content:
-------------------------------------------
? Code indent with Colon
? Blank line delimited Code snippet
? Naming conventions for packages and modules
? Naming conventions for classes, objects
? Naming conventions for functions
? Code comments

Code indent with colon:
If num>5:
Print (' yes ');
Else
Print (' no ');

Blank line delimited code snippet:
1.if
2.while
3.for
4.def
5.class

Naming conventions for packages and modules:
1. Package
Requirements are uniform in lowercase.

2. Module
Requirements are uniform in lowercase.

Naming conventions for classes and objects:
1. Class
Strict camel style: Indexuserperson

2. Objects
Requirements are uniform in lowercase.

Naming conventions for functions:
Camel style: Indexuserperson

Code Comment:
1. Single-line Comment
# One line
# both Line

2. Multi-line annotations
‘‘‘
1) One line
2) Line
3) Three line
‘‘‘

"or" "to support web development in the future:
‘‘‘
<!doctype html>


<body></body>

‘‘‘

Python Coding specification

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.