Stupid way to learn python (i)

Source: Internet
Author: User
Tags python script

Environment: notepad++,python2.7.13
Compile: Write the. py file first, and then run the script with the Python command in the terminal (the runtime terminal directory to be located in the running. py file directory)
Exercise One:
In the Python2 version, the double quotation mark "" and the single quotation mark "can be used for output without parentheses, and the statement ends without a semicolon;
When you want to output quotes in a sentence, you can use different kinds of quotes to output
You can use a text editor to write the. py suffix of the Python script, and then run the script directly in the terminal with Python.
(If you have more than one version of Python, use the Python version of the script to run the command without the version Python)
Single-line comment #; multiline comment three single or double quotation marks "and" ";
When scripting with notepad++, save the file in. py format before editing, and then continue editing to see the various colors.
Output Chinese in code: Add #--Coding:utf-8--to the beginning of the file and change the encoding settings of the notepad++.

Stupid way to learn python (i)

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.