黄金猫 发表于 2021-8-28 12:52:11

010

0.yes
1.A is bool type,result is1,B is 250is not
2.dont know
3.True
4.no false has 3 type,none ,0number,and none jihe
5.4
6.1
------------------------------
0.
1.
year = int(input("please input year number:"))

if (year%4 == 0 and year%100 != 0) or (year % 400 == 0):
    print(str(year) + " is leap year!")
else:
    print(str(year) + " is not leap year!")

*****************************
1.no diffrent
2.yes
4.yes
--------------------------
0.
>>> from fractions import Fraction
>>> Fraction(1708227363155544, 4636617128565048)
Fraction(7, 19)
1.
year = input('请输入一个年份:')

while not year.isdigit():
    year = input("抱歉,您的输入有误,请输入一个整数:")

year = int(year)
if year % 400 == 0:
    print(year, "是闰年!")
else:
    if year % 4 == 0 and year % 100 != 0:
      print(year, "是闰年!")
    else:
      print(year, "不是闰年!")
页: [1]
查看完整版本: 010