打印9 * 9乘法口诀表:
for i in range(1, 10):
for j in range(1, i+1):
print("%d * %d = %d" % (j, i, i*j), end = '\t')
print("")
判断是否是闰年:
year = int(input("请输入年份:"))
if (year % 4 == 0 and year % 100 != 0) or year % 400 == 0:
print("%d是闰年" % year)
else:
print("%d不是闰年" % year)
能被4整除但不能被100整除,或者可以被400整除