学习python,第一篇
程序员文章站
2022-07-27 20:32:44
结果:danie danie itxpl danie 猜年龄 age_itxpl = 35 for i in range(3): guess_age = int(input("guess age:")) if guess_age == age_itxpl: print("yes,you got it ......
name = "danie" name2 = name print(name,name2) name = "itxpl" print(name,name2)
结果:danie danie
itxpl danie
猜年龄
age_itxpl = 34 count = 0 while count < 3: guess_age = int(input("guess_age:")) if guess_age == age_itxpl: print("yes,you guess right!") break elif guess_age > age_itxpl: print("Make a guess!") else: print("Guess a little bigger!") count +=1 else: print("Guess the wrong invitation to dinner!")
age_itxpl = 35 for i in range(3): guess_age = int(input("guess age:")) if guess_age == age_itxpl: print("yes,you got it.") break elif guess_age > age_itxpl: print("think smaller...") else: print("think bigger!") else: print("you have tride too many time..fuck off")