Getting Started with Python-program run, annotations

Source: Internet
Author: User

1. Program operation

1.1 Python interpreter Run

File-new file Create a new edit window, enter the contents of the

Select File-save to save the program (for plain text files). Create a directory that specifically stores Python projects. Then make a meaningful name for the program, such as name.py. It is important that the file name ends with a. py.

You can now run the program with Edit-run or by pressing the CRTL+F5 key.

Enter a name (such as Frank) and press ENTER. 'll see

1.2 Command Prompt run

2. Notes

The first line is called a comment. Comments are intended to make it easier for others to understand the program and to look back at the old code. The first commandment of the programmer is "thou shalt note." Programmers should make sure that the comments are all important things,

Without having to weigh the obvious content in the code. It's not as useless as an extra comment. For example, the comments in the following example are not good

Even without annotations, you should make the code itself easy to understand.

Even Mei

Getting Started with Python-program run, annotations

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.