Austin_zhai
Austin_zhai
全部文章
分类
题解(18)
归档
标签
去牛客网
登录
/
注册
Austin_zhai的博客
全部文章
(共40篇)
题解 | #拯救被污染的字符串#
创建被污染的字符串 my_str = 'I am$ N$iuniu$, an$d I $am stu$dying in $Now$coder!' 进行特定字符的分割 my_list = my_str.split('$') 根据要求进行打印与拼接 print(my_list) print(''.j...
Python3
2022-06-24
0
242
题解 | #梦想的大学#
创建空字典survey_dict survey_dict = {} 创建死循环并进行信息交互 while True: print('If you have the chance, which university do you want to go to most?') print...
Python3
2022-06-24
0
322
题解 | #牛牛的朋友#
创建列表friends_list friends_list = ['Niu Ke Le', 'Niumei', 'Niuneng', 'GOLO'] 创建replace函数 def replace(friends_list, index): friends_list[index] = in...
Python3
2022-06-24
0
245
题解 | #喜欢的颜色#
创建字典result_dict result_dict = { 'Allen': ['red', 'blue', 'yellow'], 'Tom': ['green', 'white', 'blue'], 'Andy': ['black', 'pink'] } 使用两次fo...
Python3
2022-06-23
26
634
题解 | #遍历字典#
创建字典operators_dict operators_dict = {'<': 'less than', '==': 'equal'} 遍历排序后的字典进行信息打印 print('Here is the original dict:') for m, n in sorted(operat...
Python3
2022-06-23
10
471
题解 | #食堂点餐#
创建订单记录 order_list = ['rice', 'beef', 'chips', 'pizza', 'pizza', 'yogurt', 'tomato', 'rice', 'beef'] 初始化总计金额 total = 0 创建函数order_handle以供后续复用 def ord...
Python3
2022-06-23
0
256
题解 | #禁止重复注册#
创建现有用户和新用户两个列表 current_users = ['Niuniu', 'Niumei', 'GURR', 'LOLO'] new_users = ['GurR', 'Niu Ke Le', 'LoLo', 'Tuo Rui Chi'] 为了方便对比将现有用户列表先小写化 curren...
Python3
2022-06-23
0
266
题解 | #判断列表是否为空#
创建空列表并判断列表是否为空 my_list = [] if not my_list: print('my_list is empty!') else: print('my_list is not empty!')
Python3
2022-06-23
0
239
题解 | #累加和与平均数#
创建1-1000的列表 my_list = [] for i in range(1, 1001): my_list.append(i) 计算最小、最大、总和 print(min(my_list)) print(max(my_list)) print(sum(my_list)) 计算平均值...
Python3
2022-06-23
0
319
题解 | #发送offer#
创建offer列表 offer_list = ['Allen', 'Tom'] 使用for循环与格式化输出进行对应信息打印 for i in offer_list: print('%s, you have passed our interview and will soon become ...
Python3
2022-06-22
55
778
首页
上一页
1
2
3
4
下一页
末页