首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
AI面试、笔试、校招、雇品
HR免费试用AI面试
最新面试提效必备
登录
/
注册
牛客109168981号
获赞
0
粉丝
0
关注
0
看过 TA
2
2025
算法工程师
IP属地:江苏
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑牛客109168981号吗?
发布(118)
评论
刷题
收藏
牛客109168981号
关注TA,不错过内容更新
关注
03-09 08:49
算法工程师
题解 | 正数输出器
print(abs(int(input())))
0
点赞
评论
收藏
分享
03-08 19:30
算法工程师
题解 | 字典新增
dic = {'a': ['apple', 'abandon', 'ant'], 'b': ['banana', 'bee', 'become'], 'c': ['cat', 'come'], 'd': 'down'} letter = input() word = input() dic[letter] = word print(dic)
0
点赞
评论
收藏
分享
03-08 19:28
算法工程师
题解 | 查字典
dic = {'a': ['apple', 'abandon', 'ant'], 'b': ['banana', 'bee', 'become'], 'c': ['cat', 'come'], 'd': 'down'} n = input() print(" ".join(dic[n]))
0
点赞
评论
收藏
分享
03-08 19:21
算法工程师
题解 | 生成字典
name = input().split() language = input().split() print(dict(zip(name,language)))
0
点赞
评论
收藏
分享
03-08 18:43
算法工程师
题解 | 喜欢的颜色
result_dict = {'Allen': ['red', 'blue', 'yellow'], 'Tom': ['green', 'white', 'blue'], 'Andy': ['black', 'pink']} for name in sorted(result_dict): print(f"{name}'s favorite colors are:") print(*result_dict[name], sep="\n")
0
点赞
评论
收藏
分享
03-08 17:59
算法工程师
题解 | 首都
cities_dict = {'Beijing': {'Capital': 'China'}, 'Moscow': {'Capital': 'Russia'}, 'Paris': {'Capital': 'France'} } for city in sorted(cities_dict): print(f"{city} is the capital of {cities_dict[city]['Capital']}!")
0
点赞
评论
收藏
分享
03-08 15:47
算法工程师
题解 | 姓名与学号
my_dict1 = {'name': 'Niuniu', 'Student ID': 1} my_dict2 = {'name': 'Niumei', 'Student ID': 2} my_dict3 = {'name': 'Niu Ke Le', 'Student ID': 3} dict_list = [] dict_list.append(my_dict1) dict_list.append(my_dict2) dict_list.append( my_dict3) # 列表结构 {['name':'Niuniu','Student ID':1], ['name':'Niumei',...
0
点赞
评论
收藏
分享
03-08 15:19
算法工程师
题解 | 毕业生就业调查
survey_list = ['Niumei', 'Niu Ke Le', 'GURR', 'LOLO'] result_dict = {'Niumei':'Nowcoder', 'GURR':'HUAWEI'} for i in survey_list: for j in result_dict: if i in j: print(f"Hi, {i}! Thank you for participating in our graduation survey!") break else: print(f"Hi, {i}! Could you take part i...
0
点赞
评论
收藏
分享
03-08 14:58
算法工程师
题解 | 遍历字典
from ast import operator operators_dict = {'<':'less than','==':'equal'} print('Here is the original dict:') sorted(operators_dict) for i in operators_dict: print(f"Operator {i} means {operators_dict[i]}.") operators_dict['>'] = 'greater than' print("\nThe dict was changed to:&q...
0
点赞
评论
收藏
分享
03-08 14:16
算法工程师
题解 | 增加元组的长度
tuple1 = (1, 2, 3, 4, 5) len(tuple1) tuple2 = (6, 7, 8, 9, 10) len(tuple2) print(tuple1) print(len(tuple1)) print(tuple1+tuple2) print(len(tuple1+tuple2))
0
点赞
评论
收藏
分享
03-08 11:49
算法工程师
题解 | 修改报名名单
entry_form = ('Niuniu', 'Niumei') print(entry_form) try: entry_form[1] = 'Niukele' except TypeError : print("The entry form cannot be modified!")
0
点赞
评论
收藏
分享
03-08 11:40
算法工程师
题解 | 运动会双人项目
tuple1 = tuple(input() for i in range(2)) print( tuple1)
0
点赞
评论
收藏
分享
03-08 11:00
算法工程师
题解 | 牛牛的矩阵相加
my_list = [[1, 2, 3],[4, 5, 6],[7, 8, 9]] inp = int(input()) for i in range(len(my_list)): for j in range(len(my_list[i])): my_list[i][j] = my_list[i][j]*inp print(my_list)
0
点赞
评论
收藏
分享
03-08 10:25
算法工程师
题解 | 跳过列表的某个元素
my_list = [] for i in range(1,16): if i == 13: continue my_list.append(i) print(" ".join(map(str, my_list)))
0
点赞
评论
收藏
分享
03-08 10:20
算法工程师
题解 | 提前结束的循环
my_list = [3, 45, 9, 8, 12, 89, 103, 42, 54, 79] inp = int(input()) for i in my_list: if i == inp: break print(i)
0
点赞
评论
收藏
分享
1
2
3
4
5
6
8
创作者周榜
更多
关注他的用户也关注了:
牛客网
牛客企业服务