I'm still a beginner, and I just started to learn that Python is interested in it because I've seen it before. Eric says it's a very nice person.
Python is elegant and robust, has the power and versatility of traditional languages, and is easy to use. I can't imagine what Python can't do.
Origin: Van Rossum 1989 founder Python,voor is a CWI engineer, released the first version in early 91 because of a project need.
Upgradeable: Scalable. Easy to learn,
Python works mainly in two ways: statements and expressions, statements that use keywords to make up commands, and a command that tells the multifunction interpreter that you tell
What Python does, what it does for you, the statement can have output, or it can have no output,
For example, print ' Hello world! '
Expressions have no keywords, you can use mathematical operators to form arithmetic expressions, you can call functions with parentheses, and you can accept user input. Can not accept user input
Program output: Print statement
>>> mystring = ' hello,world! '
>>> Print mystring
hello,world!
Give a string to mystring to display the variable content with Pring
The use of print and% implements the string substitution function,
>>> print "%s is number%d!"% ("Python", 1)
Python is number 1!
% is replaced by a string,%d is replaced by an integral type,%f is a floating-point replacement, Pring can also redirect output to a file. New from python2.0
This is important.
Program Input Command:
>>> user = Raw_input (' qin ni shu ru ')
Qin ni shu Ruroot
>>> print ' ni shu ru de shi ', user
Ni shu ru de shi Root
Using the Raw_input function, enter the text
Now enter anumber:1024
>>> print ' Doubling your number:%d '% (int (num) * 2)
Doubling your number:2048
You can also enter a string value int (is the value)
#是python的注shi