day14
data = []
for i in range(1,5):
for k in range(1,5):
for m in range(1,5):
if i != k and i != m and k != m:
d = []
d.append(i)
d.append(k)
d.append(m)
data.append(d)
print(data)
print(len(data))
year = int(input("输入年"))
month = int(input("输入月"))
day = int(input('输入天'))
moths = [0,31,59,90,120,151,181,212,243,273,304,334]
if 0 < month <= 12: # 判断输入的月份是不是在1-12中间
sum = moths[month - 1]
else:
print('检查输入的月份')
sum += day # 天数=当前月份-1的总天数+当前月份的天数
leap = 0 #
if year%4 == 0 or year%4 == 0 and year%100 != 0:
leap = 1
if leap ==1 and month>2:
sum+=1
print(sum)
# 冒泡排序,终于第一次自己尝试出来了
l = [4,1,5,3,8]
for i in range(len(l)):
print(i)
for m in range(i+1):
print(m)
if l[i] < l[m]:
l[i],l[m] = l[m],l[i]
print(l)
# 输入三个整数x,y,z,请把这三个数由小到大输出。
d = []
for i in range(3):
num = int(input('请输入数字:'))
d.append(num)
for m in range(len(d)):
for n in range(m+1):
if d[m] < d[n]:
d[m],d[n] = d[n],d[m]
print(d)
# 将一个列表的数据复制到另一个列表中。
l = [1,2,3,4,5]
c = []
for i in range(len(l)):
c.append(l[i])
print(c)
b = l[:]
print(b)
# 输出 9*9 乘法口诀表。
for i in range(1,10):
for m in range(1,i+1):
# print(i,'*',m,'=',i*m)
print('{}*{}={}\t'.format(i,m,i*m),end='')
print()
学习最大的乐趣在于分享,我是绝世老中医,欢迎来诊
个人qq:1978529954