目录
1.单词分析
2.成绩统计
3.门牌制作
4.卡片
5.跑步训练
6.蛇形填数
7.时间显示
1.单词分析
1.单词分析 - 蓝桥云课 (lanqiao.cn)
s = list(input())
maxx = 0
for i in s:num = s.count(i)if num>maxx:sm = imaxx = numif num == maxx:if ord(sm)>ord(i):sm = i
print(sm)
print(maxx)
2.成绩统计
2.成绩统计 - 蓝桥云课 (lanqiao.cn)
import os
import sys# 请在此输入您的代码
n = int(input())
data = []
for i in range(n):data.append(int(input()))
ans1 = 0
ans2 = 0
for i in data:if i>=85:ans1 += 1if i>=60:ans2 += 1
print(f'{round(ans2*100/n)}%')
print(f'{round(ans1*100/n)}%')
3.门牌制作
3.门牌制作 - 蓝桥云课 (lanqiao.cn)
import os
import syscou = 0
# 请在此输入您的代码
for i in range(1,2021):i = str(i)cou += i.count('2')
print(cou)
4.卡片
5.卡片 - 蓝桥云课 (lanqiao.cn)
st = ''
flag = 0
# 请在此输入您的代码
for i in range(1,999999):ans = ii = str(i)st += inum = st.count('1')if num>2021:break
print(ans-1)
5.跑步训练
6.跑步锻炼 - 蓝桥云课 (lanqiao.cn)
Python 日期时间(datetime) - 菜鸟教程 (cainiaojc.com)
import os
import sys
import datetime# 请在此输入您的代码
start = datetime.date(2000,1,1)
end = datetime.date(2020,10,1)
days = datetime.timedelta(days=1)
# print(start)
# print(end-start)
# print(days)
ans = 0
while end>=start:if start.day == 1 or start.weekday() == 0:ans += 2else:ans += 1start += days
print(ans)
6.蛇形填数
7.蛇形填数 - 蓝桥云课 (lanqiao.cn)
import os
import sys# 请在此输入您的代码
num1 = 1
for i in range(1,39):num1 += i
data = []
for i in range(num1, num1+39):data.append(i)
print(data[19])
7.时间显示
10.时间显示 - 蓝桥云课 (lanqiao.cn)
import os
import sys# 请在此输入您的代码
# 46800999t = int(input())
t = t//1000
t %= (60*60*24)
h = t//(60*60)
m = (t-(h*60*60))//60
s = t-(h*60*60)-(m*60)
if h<10:h = '0'+str(h)
if m<10:m = '0'+str(m)
if s<10:s = '0'+str(s)
print(f'{h}:{m}:{s}')