小宇啊
小宇啊
全部文章
分类
归档
标签
去牛客网
登录
/
注册
小宇啊的博客
全部文章
(共111篇)
题解 | #兔子的数量#
def rabbit_population(n): if n == 1: return 2 elif n == 2: return 3 else: return rabbit_population(n-1) + rabbit_p...
2024-08-06
0
122
题解 | #截断电话号码#
import re string = input() fir_result = re.sub(r"\s+","",string) sec_result = re.sub(r"#.*","",fir_result) ...
2024-08-02
0
128
题解 | #提取数字电话#
import re string = input() pattern = r"[^0-9]+" print(re.sub(pattern,"",string))
2024-08-02
0
136
题解 | #正则查找网址#
import re address = input() pattern = r'https://www' match_result = re.match(pattern,address) print(match_result.span())
2024-08-02
0
118
题解 | #班级管理#
class Student: def __init__(self,name,student_id,score,grades): """ 初始化学生信息。 :param name:学生姓名,字符串类型 ...
2024-08-02
0
111
题解 | #单词造句#
words = [] while True: word = input() if word == "0": break words.append(word) sentence = " ".join(words) ...
2024-08-02
0
150
题解 | #使用字典计数#
nounce = input() letter_counts = {} for char in nounce: if char != ' ': if char in letter_counts: letter_counts[char] += 1 ...
2024-08-02
0
108
题解 | #查字典#
alph = { "a": ["apple", "abandon", "ant"], "b": ["banana", "bee", "...
2024-08-01
0
119
题解 | #姓名与学号#
my_dict_1 = {'name': 'Niuniu','Student ID': 1} my_dict_2 = {'name': 'Niumei','Student ID': 2} my_dict_3 = {'name': 'Niu Ke Le','Student ID': 3} dict_l...
2024-08-01
0
128
题解 | #牛牛的矩阵相加#
n = int(input()) matrix = [ [1,2,3], [4,5,6], [7,8,9] ] result_matrix = [[0 for _ in range(len(matrix[0]))] for _ in range(len(matrix))] ...
2024-08-01
0
133
首页
上一页
3
4
5
6
7
8
9
10
11
12
下一页
末页