下面是一个简单的if循环程序:
1 age_konishi = 23 #赋值给变量 2 guess_age = int(input("Age: ")) #定义输入字符类型 3 4 if guess_age == age_konishi: #开始判断 5 print("Yoshi! Sweetie, you‘re awesome!") 6 elif guess_age > age_konishi: 7 print("Idiot! I‘m not that old!") 8 else: 9 print("Honey, you‘re so sweet!")
时间: 2024-10-12 21:15:51