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! "
- 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! "
- 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
- 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:
- a=100.0
- b=201.1
- c=2343
- print (a+b+c)/c
The above content is part of the introduction to the Python getting started tutorial.