小伙子66
小伙子66
全部文章
题解
归档
标签
去牛客网
登录
/
注册
小伙子66的博客
全部文章
/ 题解
(共20篇)
题解 | #自动售卖饮料机#
kind_of_drink=input() print("What kind of drink would you like?") if str(kind_of_drink) == 'cola': print('Below is your cola. Please check it!') e...
Python3
2022-06-14
0
218
题解 | #牛牛的朋友#
friends_list=['Niu Ke Le', 'Niumei', 'Niuneng', 'GOLO'] print(friends_list) friends_list_new=[] for name in friends_list: name1=name.replace(name,...
Python3
2022-06-14
0
250
题解 | #首都#
cities_dict={'Beijing': {'Capital': 'China'},'Moscow': {'Capital': 'Russia'},'Paris': {'Capital': 'France'}} for city in sorted(cities_dict,reverse=Fa...
Python3
2022-06-10
1
336
题解 | #喜欢的颜色#
result_dic={'Allen': ['red', 'blue', 'yellow'], 'Tom': ['green', 'white', 'blue'], 'Andy': ['black', 'pink']} for dic in sorte...
Python3
2022-06-10
6
444
题解 | #姓名与学号#
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_list=[]...
Python3
2022-06-10
1
374
题解 | #毕业生就业调查#
survey_list=['Niumei','Niu Ke Le','GURR','LOLO'] result_dic={'Niumei': 'Nowcoder','GURR': 'HUAWEI'} for name in survey_list: if name in result_dic...
Python3
2022-06-10
0
345
题解 | #遍历字典#
operator_dict={'<':'less than','==':'equal'} print('Here is the original dict:') for x in sorted(operator_dict): print(f'Operator {x} means {ope...
Python3
2022-06-10
49
1168
题解 | #牛客运动会#
my_tuple=('Tom','Andy') print("Here is the original tuple:") for i in my_tuple: print(i) print(" ") try: my_tuple[1]='Allen' except TypeError:...
Python3
2022-06-10
0
271
题解 | #食堂点餐#
order_list=['rice', 'beef', 'chips', 'pizza', 'pizza', 'yogurt', 'tomato', 'rice', 'beef'] sum=0 for i in order_list: price = 8 if i == 'pizza...
Python3
2022-06-10
0
237
题解 | #禁止重复注册#
new_users=['GurR','Niu Ke Le','LoLo','Tuo Rui Chi'] for name in new_users: if name.upper() in current_users: print(f'The user name {name} ...
Python3
2022-06-10
0
332
首页
上一页
1
2
下一页
末页