Basic syntax for Python

Source: Internet
Author: User

Simple Python Program

Open terminal, enter Python, go to Python interactive input interface, start writing simple python program

Print the string Hello World using the print function above and use the Quit function to exit the interactive input interface

Write the Python code inside the file and let Python execute the code inside the file.

Gedit hello.py

  

The above uses gedit to write the Hello code, the command line executes the code inside the file

Run the file directly from the terminal

At the beginning of the file, #! indicates the location of the Python interpreter, and/hello.ph will load the python according to the path indicated by #! at execution time, and then the code in the execution file is interpreted by Python.

Python identifier:

The python identifier is used to denote

Basic syntax for Python

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.