神奇的追梦人就要上岸了
神奇的追梦人就要上岸了
全部文章
分类
归档
标签
去牛客网
登录
/
注册
神奇的追梦人就要上岸了的博客
全部文章
(共42篇)
题解 | 字符子串的查找
long_str = input() position = long_str.find("NiuNiu") print(position) 注意字符串和列表都是可迭代可遍历的对象
2025-06-27
0
41
题解 | 字符的类型比较
s =input() print(s.isalpha(),s.isdigit(),s.isspace(),sep="\n") print有end参数还有seq参数和R的paste0有点像
2025-06-26
0
42
题解 | 列表中第一次出现的位置
a = list(input().split(' ')) # for idx,val in enumerate(a): # if val == "NiuNiu": # print(idx) print(a.index("NiuNiu")...
2025-06-26
0
31
题解 | 错误出现的次数
# x = list(map(int,input().split(" "))) # print(x.count(0)) # 整数零 seq = input().split(' ') print(seq.count('0')) # 字符串零
2025-06-26
0
31
题解 | 数学幂运算
# m1 x,y = input().split(" ") print(pow(int(x),int(y))) print(pow(int(y),int(x))) # m2 x,y=map(int,input().split()) print(x**y,y**x,sep='\n...
2025-06-26
0
38
题解 | 使用字典计数
x = input() freq={} for i in x: if i in freq: freq[i]+=1 else: freq[i]=1 print(freq) 注意在Python中字符串是可迭代的字符向量
2025-06-26
0
40
题解 | 查字典
a = { "a": ["apple", "abandon", "ant"], "b": ["banana", "bee", "bec...
2025-06-25
0
32
题解 | 生成字典
x = list(input().split(" ")) y = list(input().split(" ")) l = {n:b for n, b in zip(x, y)} print(l)
2025-06-25
0
41
题解 | 喜欢的颜色
result_dict = {'Allen': ['red', 'blue', 'yellow'],'Tom': ['green', 'white', 'blue'],'Andy': ['black', 'pink']} for key, value in sorted(result_dict.it...
2025-06-25
0
38
题解 | 首都
cities_dict = { 'Beijing': {'Capital': 'China'}, 'Moscow': {'Capital': 'Russia'}, 'Paris': {'Capital': 'France'} } for city_key in sorted(...
2025-06-24
0
28
首页
上一页
1
2
3
4
5
下一页
末页