#if adn else 一般判断 #input 用户输入 ''' age_of_wuyue = input("请输入您的年纪:") age_of_princal = int (age_of_wuyue)+20 guess_age = int( input("请猜猜校长的年纪:")) if guess_age==age_of_princal: print("yes,you got it.... ") else: print("no,it's wrong....") ''' #一般判断结束 #基本输入 ''' name = input("your name:") age = input("your old:") print(name,age) ''' #基本输入输出结束 #input 接受的所有数据都是字符串,即便你输入的是数字,但依然会被当成字符串来处理 #string 把数据转成字符串用str #integer 把字符串转成数据用int ''' death_age=100 name=input("your name:") age=input("your age:") print(type(age)) print("your name:",name) print("your can still live for" ,death_age-int(age),"yeats....") ''' #多分支语句 elif score=int(input("score:")) if score>90: print("A") elif score>80: print("B") elif score>70: print("C") elif score>60: print("D") elif score>50: print("继续努力哦") elif score>0: print("你已经被开除了")