The first Python program

Source: Internet
Author: User

When you start Python, the following prompt appears:

This is the entrance to the hall of Python, the first step in controlling the calculation, and this is the interactive Python interpreter. Enter the following code:

When you hit the ENTER key, get the following output:

This is the first Python program, and the program is gone after the interactive interpreter exits. The interactive interpreter is a temporary program that runs the environment without saving the running program.

The program we write is ultimately saved in the file. So the next time we want to run the program, we can run the program file we saved last time.

Now let's write a simple Python program.

Open Notepad and write the following to the file:

Print ("Hello world!")

Save as helloworld.py file,. py suffix is to let others know that this is a python file.

In the DOS window, enter the following command and hit enter to get the same output.

The first Python program

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.