01python basics _ 01 code writing considerations _ continuous updates, 01python_01

Source: Internet
Author: User

01python basics _ 01 code writing considerations _ continuous updates, 01python_01

1. describes the compilation method used.

1 #! /Usr/bin/python

2. Description of character encoding

1 # coding = UTF-8

3. print by default, the output is a line feed. To implement a line feed, you must add a comma at the end of the variable.

# Output without line breaks
1 print x, 2 print y, 3 print x, y

4. You can use a slash (\) to split a line of statements into multiple lines for display.

1 total = item_one + \ 2 item_two + \ 3 item_three

5. The statement contains [], {}, or () brackets and does not need to use multiline connectors.

1 days = ['monday', 'tuesday', 'wednesday', 2 'thursday', 'Friday']

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.