First use of python notes (not getting started), python notes

Source: Internet
Author: User

First use of python notes (not getting started), python notes

I have never been familiar with python before. Here I will write my own learning process and experience on python.

First, install python, open the official website: http://python.org. Click Download. I chose 3.5.1 version for installation.

Next, follow the tutorial to start learning:

Then we started the first classic program and entered the following command in the interactive Interpreter:

>>> Print "hello world! ";

 

 

 

An error occurred at the beginning. The error message is: "SyntaxError: invalid syntax".

It turns out that this is the syntax of version 2. Version 3 should be enclosed in brackets, so you should enter

>>> Print ("hello world! ");

After correction, click "enter" and the next line will print hello world!

Next, we will find that the algorithms, variables, statements, functions, modules, and strings introduced in the tutorial are very similar to C ++ \ C #, so it is easy to learn. The difference is that python does not add any extra points at the end of each line, but it requires a high format.

When the python interactive editor exits, everything input will be lost. Therefore, you need to save the program in the text editor and install python with its own IDLE. After opening the New File, you can write code in a New editing window, it is very convenient. It neither has an interactive prompt nor can automatically detect line breaks.

Similarly, input print ("hello world! ");

Save and click Run Python Shell or press Ctrl + F5 to Run.

The Python interactive interpreter cannot save programs, while the programs saved by IDLE can be run using Python Shell.

Q: What are their differences?

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.