Many of you are very interested in python. Although codecademy abroad is very fun to learn programming, many of you do not have the habit of reading English websites. all of you have the idea to write this article.
Before that, of course, I would like to declare that I still think ruby is more fun and I will write ruby later.
1. First say hello.
2. Write the variable.
mynum=12=
3. Write a function
Here we have to stop. The python statement block is represented by indentation, and there is a colon every time you want to indent it:
If you remember this, you will understand python in half.
4. write comments
5 string method
len( lower( upper( str(123 int()
6. Add strings
+
7. format the output
name= %name
% Percent is formatted output, replace % s with name
8. obtain user input.
name=raw_input( name
9 Control Process
10 import module
threading
11 playlist
list=[1,2,3,4,56 list[1:3 list[:2 list[1 i i
12 tuples
(1,2,3)
13. Dictionary
d = { : 1, : 2, : 3}
14 play Loop
for i in range(12):
print i
for i in [1,2,3]:
print i
15 legendary list Derivation
[i**2 i range(12) i%2==0]
16 categories
==Hymenz(
17 files
f=open(,f.close()
If you haven't played enough after reading this, contact your friend for a chat http://www.cnblogs.com/hymenz/archive/2013/05/27/3101347.html.