Operations on the editor in the Python getting started tutorial

Source: Internet
Author: User

This article describes how to quickly learn the specific methods and practical application skills of the Python getting started tutorial. If you want to make great progress in the learning process of the Python getting started tutorial, our article has a related introduction, and I hope you will gain some benefits.

Hello world

After installing Python (my local version is 2.5.4), open IDLE (Python GUI). This program is a Python interpreter and the statements you write can be run immediately. let's write down a famous Program Statement:
Print "Hello, world! "And press Enter. you can see this famous saying that K & R has been introduced into the program world. select "File" -- "New Window" in the interpreter or press Ctrl + N to open a New editor. write the following statement: print "Hello, world! "Raw_input (" Press enter key to close this window ");

Save As a. py file. Press F5 to see the running result of the program. This is the second running method of the Python programming language.
Find the. py file you saved and double-click it. You can also see the program result. The Python program can run directly. This is an advantage over Java.

International support

We try to greet the world in another way. Create an editor and write the following code:
Print "welcome to the Olympic Games China! "

 
 
  1. raw_input("Press enter key to close this window"); 

When you save the code, the Python getting started tutorial will prompt you whether to change the character set of the file. The result is as follows: print "welcome to the Olympic Games China! "

 
 
  1. raw_input("Press enter key to close this window"); 


Change this character set to a more familiar form: print "welcome to the Olympic Games China! "# Examples of using Chinese

 
 
  1. raw_input("Press enter key to close this window"); 

The program runs well.

Easy-to-use Calculator

It is too much trouble to use the calculator that comes with Microsoft to count. Open the Python interpreter and perform computation directly:
 

 
 
  1. a=100.0  
  2. b=201.1  
  3. c=2343 
  4. print (a+b+c)/c  

The above content is part of the introduction to the Python getting started tutorial.

Related Article

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.