练习

#查成绩
score=int(input("your score:"))

if score>90:
    print("A")
elif score>80:
    print("B")
elif score>70:
    print("C")
elif score>60:
    print("D")
else:
    print("")

 

#猜年龄
age_of_princal=21

age_of_guess=int(input("your age:"))

if age_of_guess==age_of_princal:
    print("Yes,you are right")
elif age_of_guess>age_of_princal:
    print("you can try smaller...")
else:
    print("you can try bigger...")
#用户输入
death_Year=80

name=input("Your name:")
age=input("Your age:")

print(type(age))

print(name)
print("You can still alive: "+str(death_Year-int(age))+"years")
#print("You can still alive: ",death_Year-int(age),"years")

 

点赞