Cheno>_<o
Cheno>_<o
全部文章
题解
归档
标签
去牛客网
登录
/
注册
Cheno>_<o的博客
全部文章
/ 题解
(共42篇)
题解 | #喜欢的颜色#
# 创建字典result_dict,作为已记录的调查结果 result_dict = {'Allen': ['red', 'blue', 'yellow'], 'Tom': ['green', 'white', 'blue'], 'Andy': ['black', 'pink']} for nam...
Python3
2022-06-22
0
292
题解 | #姓名与学号#
# 创建一个依次包含键-值对{'name': 'Niuniu'和'Student ID': 1}的字典my_dict_1 my_dict_1 = {'name': 'Niuniu','Student ID': 1} # 创建一个依次包含键-值对{'name': 'Niumei'和'Student ...
Python3
2022-06-22
0
261
题解 | #毕业生就业调查#
# 创建列表survey_list,作为调查名单 survey_list = ['Niumei','Niu Ke Le','GURR','LOLO'] # 创建字典result_dict,作为已记录的调查结果 result_dict = {'Niumei': 'Nowcoder', 'GURR':...
Python3
2022-06-22
3
389
题解 | #遍历字典#
# 创建字典operators_dict operators_dict = {'<': 'less than', '==': 'equal'} # 使用print()语句一行打印字符串'Here is the original dict:' print('Here is the origin...
Python3
2022-06-22
0
345
题解 | #牛客运动会#
# my_tuple元组,记录参赛名单 my_tuple = tuple(['Tom','Andy']) print('Here is the original tuple:') for i in my_tuple: print(i) try: my_tuple[1]='A...
Python3
2022-06-22
0
274
题解 | #食堂点餐#
# 创建order_list记录点单情况 order_list = ['rice', 'beef', 'chips', 'pizza', 'pizza', 'yogurt', 'tomato', 'rice', 'beef'] total = 0 price = 0 # for循环遍历order_...
Python3
2022-06-22
0
329
题解 | #禁止重复注册#
# 创建current_users列表 current_users = ['Niuniu','Niumei','GURR','LOLO'] # 创建new_users列表 new_users = ['GurR','Niu Ke Le','LoLo','Tuo Rui Chi'] # for循环遍历 ...
Python3
2022-06-22
0
349
题解 | #判断列表是否为空#
# 创建一个空列表my_list my_list = [] # 1.我的解法: if len(my_list)==0: print('my_list is empty!') else: print('my_list is not empty!') # 2.评论区解法: # ...
Python3
2022-06-22
39
1233
题解 | #找到HR#
# 创建user_list列表 user_list = ['Niuniu','Niumei','HR','Niu Ke Le','GURR','LOLO'] # for循环遍历 for item in user_list: if item == 'HR': print(f'...
Python3
2022-06-22
0
287
题解 | #团队分组#
# 创建一个列表group_list,包含这个小组的成员名称 group_list = ['Tom', 'Allen', 'Jane', 'William', 'Tony'] # slice切片函数: 第一个参数-start index 第二个参数-end index,第三个参数为step间距(可...
Python3
2022-06-22
36
763
首页
上一页
1
2
3
4
5
下一页
末页