First, a new knowledge of Python
Python is a completely object-oriented language, with its elegant, affinity features are many program developers love. At the same time, it is an open source explanatory language and dynamic language. Has a good scalability.
Starting from Hello World:
When we learn most computer languages, we try to say hello to the world in the first language. When the first Hello World is printed on our screen, there will be little excitement O (∩_∩) o~
So, how do we greet the world with Python? (⊙o⊙) Well, not too simple >_<, there are wood, there are wood! Haha, look to know:
>>>print "Hello World"
Hello World
Uh, well, that's the simple ^_^.
Ii. Basics of Python
1. Basic data types
1.1 Shaping
i = 1
1.2 Floating-point type
F = 1.2
1.3 String Type
s = "string"
For strings, you can use double quotation marks or single quotes. If the string contains quotation marks, you can use \ ' or \ ' to escape, or you can use the form "'" or "'" (Note:
The quotation marks on both sides must appear in pairs.
1.4 Boolean Type
b = True
c = False
Note: As with other languages, a value in Python, as long as it is not null, "", False, 0, then its boolean value must be True.
1.5 Checking data types
In Python, through the type () function, you can check what type a value is:
>>> A = 10
>>> type (a)
<type ' int ' >
2. Sequence
2.1
Not finished, to be continued ...
Python Learning Notes