题目:
十九
birthday = int(input(“请输入生日日期:”))
Set1 = [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31]
Set2 = [2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31]
Set3 = [4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31]
Set4 = [8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31]
Set5 = [16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]
if (birthday == (Set1[0] + Set2[0]+ Set3[0])):
print(“在数字集里”)
elif(birthday == (Set1[0] + Set2[0] + Set4[0])):
print(“在数字集里”)
elif(birthday == (Set1[0] + Set2[0] + Set5[0])):
print(“在数字集里”)
elif(birthday == (Set2[0] + Set3[0] + Set4[0])):
print(“在数字集里”)
elif(birthday == (Set2[0] + Set3[0] + Set5[0])):
print(“在数字集里”)
elif(birthday == (Set3[0] + Set4[0] + Set5[0])):
print(“在数字集里”)
else:
print(“不在数字集里”)
二十
height = 1.75
weight = 80.5
BMI = kg / tall * tall
if BMI < 18.5:
print(“过轻”)
elif 18.5 <= BMI < 25:
print(“正常”)
elif 25 <= BMI <28:
print(“过重”)
elif 28 <= BMI < 32:
print(“肥胖”)
elif BMI > 32:
print(“严重肥胖”)
二十一
num = int(input(“请输入一个年份:”))
if num % 4 == 0 and num % 100 != 0 or num % 400 == 0:
print(“这个年份是闰年”)
else:
print(“不是闰年”)
二十二
import random
num = int(input(“请输入一个两位数字: