1. First Python program
Print " hello,world! "# After seeing it I couldn't help but put parentheses and semicolons.
2. Variables
Name = "Wenjinli" age = #这么不正经的写法, even without distinguishing between variable types
3.for Cycle
Age = 56for I in range (3): #想当年在OC里面是这样写的 for (nsstring*str in array) uh .... _age = Int (input (' gessage: ')) if age = = _age: print (' congratulation! ') Break Elif Age > _age: print (' Think bigger ') else: print (' Think smaller! ') else: print (' You have tried too Manylallala times ') #刷新三观的认知, actually add else after for loop
For I in range (9):
For j in Range (9):
result = (i+1) * (j+1)
Print ("{0}*{1}={2}". Format (i+1,j+1,result)) #99乘法表
4.while Cycle
Count =0 whileCount < 3: _age= Int (Input ('Gessage:')) ifAge = =_age:Print('congratulation!') Break elifAge >_age:Print('think bigger') Else: Print('Think smaller!') Count+ = 1Else: Print('You have tried too many times') #while竟然也可以加else
Python The first step starts with the basics (i)