The first Python program

Source: Internet
Author: User

In the learning of their own a Python applet, for beginners, should not copy and paste code, this is not conducive to detailed grammar and errors, encountered errors do not first think of help, first look at the error message oneself think of solutions, really do not have the situation to seek help, this is conducive to the ability to exercise problem solving.

    • Run Python code with the following two steps (e.g. running helloworld.py)

(It is important to note that if your code is placed in a directory on your hard disk, you first need to switch to this directory in a DOS environment and then run the code (my code is in the C/python34/coder windos environment, click Run-"cmd-" CD Python34/coder, Run Python again)

    1. Switch to the directory where the code is stored under DOS commands;
    2. Enter Python helloworld.py
    • Python error message

The actual position of the Python code error message is the angle bracket (^) Hint section

Code Considerations for printing HelloWorld:

Print HelloWorld is basically similar to the syntax of other languages, with the print function or simply write "HelloWorld" on the console, with the same effect as single and double quotes.

Note If you print with the print function, brackets are required after print, and the Print keyword does not support uppercase.

Syntax such as:

Print ("Hello world!")

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.