"0 Basic Learning Python" 01

Source: Internet
Author: User

Objective
Python is a cross-platform language

Install Python (Mac OS X)
1. Download python in www.python.org/downloads and install it like any other software.
2. Open: Locate the Python 2.7.X folder, double-click Idle, and wait for the idle load to complete.
Create your first program
After idle loading, the Python Shell.shell is opened where the Python command is entered.
The command prompt indicates that the computer is ready to receive user commands. Command prompt for Python:>>>
Chapter One deep into Python
Python is case sensitive.
When idle, each time you have to write a single line of code, you can use the file editor in idle, not the shell

Ways to Use the file editor
1. Click file-"New FIle" in the menu bar
2. Enter your code in the pop-up editor and do not need to >>>

3. Menu bar Select Run-"Run module

4. If a saved window appears, select Save

After a few moments, the Phtyon shell appears and prints the information.

Raw_input () function

The Raw_input () function can be used to enter a string after the prompt

  

SELECT statement (if,else,elif)

Note the point: 1. Indent 2. Colon

If name = = "ZQL":    print "hello!"

Loop statement (while)

Note points: 1. Indent (4) 2. Colon

While True:     print "Hello"

  

"0 Basic Learning Python" 01

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.