各位大佬,请问这个代码怎么写,拜托
天数计算 I获取用户输入月份,输出该月有多少天(不考虑闰年)
用python d = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}
i = int(input('Please input a month:'))
print(d) suchocolate 发表于 2021-11-9 17:34
谢谢大佬 m = int(input())
print(28 if m == 2 else 31 if (m < 8 and m%2) or (m > 7 and not m%2) else 30)
页:
[1]