莫燿汶
莫燿汶
全部文章
分类
题解(62)
归档
标签
去牛客网
登录
/
注册
莫燿汶的博客
第一语言python的小白
全部文章
(共60篇)
题解 | #牛牛的矩阵相加#
lis = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] num = int(input()) lis = list(map(lambda x: list(map(lambda i: i * num, x)), lis)) print(lis)嵌了两层map......
Python3
2022-08-16
3
393
题解 | #格式化清单#
food = ["apple", "ice cream", "watermelon", "chips", "hotdogs", "hotpot"] while food: ...
Python3
2022-08-16
0
282
题解 | #列表的最大与最小#
lis = [x for x in range(10, 51)] print(lis) print(lis[0], lis[-1], sep=" ")列表生成式底层调用的是c,理论上比for循环会快很多
Python3
2022-08-16
0
305
题解 | #验证登录名与密码#
admin = {"admis": "Nowcoder666"} name = input() password = input() if admin.get(name) == password: &...
Python3
2022-08-16
0
274
题解 | #判断布尔值#
bool1 = int(input()) if bool1: print("Hello World!") if not bool1: print("Erros!") 在python中将返回值为大于0的值判断...
Python3
2022-08-15
4
457
题解 | #牛牛的替换#
st = input()[2::].split() rep = input() a = 0 for i in range(2): rep = rep.replace(st[a],st[a+1]) a += 2 print(rep)
Python3
2022-05-20
0
318
题解 | #记票统计#
import sys mamber, name, pepple, votes = [line.replace("\n", "").split() for line in sys.stdin] a = 0 for i in name: answer = votes.count(i) ...
Python3
2022-05-06
0
360
题解 | #[NOIP2010]数字统计#
L, R = map(int, input().split()) lis = [] for i in range(L, R + 1): lis += list(str(i)) print(lis.count("2"))
Python3
2022-05-03
0
330
题解 | #The Biggest Water Problem#
num = input() while True: if len(num) > 1: num = str(sum(list(map(int, list(num))))) else: print(num) break
Python3
2022-05-03
0
303
题解 | #数位五五#
a, b = map(int, input().split()) n = 0 for i in range(a, b + 1): ii = sum(list(map(int, list(str(i))))) # 现将数字转换成str再转成list再用map将元素转成int在将map对象转成l...
Python3
2022-05-03
0
357
首页
上一页
1
2
3
4
5
6
下一页
末页