Today I've learned more about Python's outlook and basics (development tools, variables, formatted output, loops)
1.python variables: Used to store data, dynamic types that don't need to be defined, but require strong conversions
Name= "Peter"
age=11
Age=int (Input ("age"))
2. Formatted output
Name = input ("Name:")
age = Int (input ("Age:"))
#第一种方法
info = "info for%s,name:%s,age:%d"% (name,name,age)
Print (info)
#第二种方法
Info2 = "info for {name},name:{name},age:{age}". Format (Name=name,age=age)
Print (Info2)
3. Cycle (While,for,brek,continue)
Age Game:
#年龄判断
age_of_jim=39
Count=0
While count<3:
Age=int (Input ("Age:"))
If Age==age_of_jim:
Print ("Yes,guess got It")
Break
Elif age<39:
Print ("Guess is smaller")
Else
Print ("Guess is bigger")
Count=count+1
If count==3:
Continue_confirm=input ("Continue_confirm:")
If continue_confirm! = ' n ':
Count=0
If count==3:
Print ("You guess Fail")
#for Cycle
For I in Range (0,10):
Print ("--", i)
For j in Range (10):
Print (j)
If j>5
Break
The first day of Python learning