无名帝师
无名帝师
全部文章
分类
题解(12)
归档
标签
去牛客网
登录
/
注册
无名帝师的博客
全部文章
(共8篇)
#球的体积与 表面积
import math def V(r): v = 4 / 3 * math.pi * r**3 return v def S(r): s = 4 * math.pi * r**2 return s if __ name __ == '__ main __': y = map(int, input...
Python3
2022-06-23
0
210
题解 | #元组的操作#
list = [3, 6, 9, 0, 5, 8] tuple = tuple(list) print(tuple[3:]) n = int(input()) if n not in tuple: list.extend([n, n, n]) tuple = (list) print(len(tup...
Python3
2022-06-23
0
205
题解 | #查字典#
fruit = ['apple', 'banana', 'strawberry', 'orange', 'mango', 'grape', 'blueberry'] number = [1, 3, 5, 6, 13, 21, 10] dict ={} for i in range(0, 7): di...
Python3
2022-06-23
0
251
题解 | #字符类型计数#
s = str(input()) list = [] count_al = count_di = count_sp = count_ot = 0 for i in s: list.append(i) for j in list: if j.isalpha(): count_al += 1 elif ...
Python3
2022-06-23
0
278
题解 | #牛牛的绩点#
dict = {'A':4.0, 'B':3.0, 'C':2.0, 'D':1.0, 'F':0} grade_list = [] score_list = [] while True: x = input() if x == 'False': break else: y = int(input(...
Python3
2022-06-23
0
189
#栈与队列的实现#
list1 = [] list2 = [] x = [int(input()), int(input())] for i in x: list1.append(i) list2.append(i) print(list1) print(list2) list1.pop() list2.pop(0) ...
Python3
2022-06-22
0
232
题解 | #密码游戏#
list = list(map(int, str(input('')))) for i in range(0, 4): list[i] = (list[i] + 3) % 9 def swapPositions(list, pos1, pos2, pos3, pos4): list[pos1], l...
Python3
2022-06-22
0
149
题解 | #牛牛的矩阵乘法#
#牛牛的矩阵乘法 import copy X = [[13, -1, 4], [5, 0, 6], [1, 9, -3]] Y = copy.deepcopy(X) N = [] for i in range(0, 3): for j in range(0, 3): N = Y[i][j] ...
Python3
2022-06-22
1
344