首页
题库
公司真题
专项练习
面试题库
在线编程
面试
面试经验
AI 模拟面试
简历
求职
学习
基础学习课
实战项目课
求职辅导课
专栏&文章
竞赛
搜索
我要招人
发布职位
发布职位、邀约牛人
更多企业解决方案
在线笔面试、雇主品牌宣传
登录
/
注册
牛客185792820号
获赞
2
粉丝
1
关注
1
看过 TA
1
IP属地:四川
暂未填写个人简介
私信
关注
拉黑
举报
举报
确定要拉黑牛客185792820号吗?
发布(32)
评论
刷题
牛客185792820号
关注TA,不错过内容更新
关注
2023-09-20 20:47
题解 | #正数输出器#
print(abs(int(input())))
0
点赞
评论
收藏
分享
2023-09-20 20:45
题解 | #朋友的年龄和#
num_list = list(int(x) for x in input().split(' ')) print(sum(num_list))
0
点赞
评论
收藏
分享
2023-09-19 10:35
题解 | #喜欢的颜色#
result_dict = {'Allen': ['red', 'blue', 'yellow'],'Tom': ['green', 'white', 'blue'],'Andy': ['black', 'pink']} for name in sorted(result_dict): color = result_dict[name] print(f"{name}'s favorite colors are:") for cl in color: print(cl)
0
点赞
评论
收藏
分享
2023-09-19 10:13
题解 | #首都#
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
点赞
评论
收藏
分享
2023-09-14 16:32
题解 | #毕业生就业调查#
survey_list = ['Niumei','Niu Ke Le','GURR','LOLO'] result_dict = {'Niumei':'Nowcoder','GURR':'HUAWEI'} for key in survey_list: if key in result_dict: print(f'Hi, {key}! Thank you for participating in our graduation survey!') else: print(f'Hi, {key}! Could you take part in our...
0
点赞
评论
收藏
分享
2023-09-14 16:21
题解 | #遍历字典#
operators_dict = {'<':'less than','==':'equal'} print('Here is the original dict:') for i in sorted(operators_dict,reverse=False): print(f'Operator {i} means {operators_dict[i]}.') operators_dict['>'] = 'greater than' print() print('The dict was changed to:') for i in sorted(operators_dic...
0
点赞
评论
收藏
分享
2023-09-14 15:32
题解 | #增加元组的长度#
n1_tuple = tuple(range(1,6)) print(n1_tuple) print(len(n1_tuple)) n2_tuple = tuple(range(6,11)) n3_tuple = n1_tuple + n2_tuple print(n3_tuple) print(len(n3_tuple))
0
点赞
评论
收藏
分享
2023-09-14 15:23
题解 | #名单中出现过的人#
name_tuple = ('Tom', 'Tony', 'Allen', 'Cydin', 'Lucy', 'Anna') print(name_tuple) if input() in name_tuple: print('Congratulations!') else: print('What a pity!')
0
点赞
评论
收藏
分享
2023-09-14 14:41
题解 | #修改报名名单#
entry_form = ('Niuniu','Niumei') print(entry_form) try: entry_form[1] = 'Niukele' except TypeError: print('The entry form cannot be modified!')
0
点赞
评论
收藏
分享
2023-09-13 15:44
题解 | #牛牛的矩阵相加#
matrix = [[1,2,3],[4,5,6],[7,8,9]] num = int(input()) def count(x: list): newlist =[] for i in x: newlist.append(i*num) return newlist print(list(map(count,matrix)))
0
点赞
评论
收藏
分享
2023-09-13 15:26
题解 | #跳过列表的某个元素#
num_list = list(int(x) for x in range(1,16)) for i in num_list: if i-13: print(i,end=' ') else: continue
0
点赞
评论
收藏
分享
2023-09-13 15:09
题解 | #找到HR#
users_list = ['Niuniu','Niumei','HR','Niu Ke Le','GURR','LOLO' ] for i in users_list: if i == 'HR': print(f'Hi, {i}! Would you like to hire someone?') else: print(f'Hi, {i}! Welcome to Nowcoder!')
0
点赞
评论
收藏
分享
2023-09-13 15:03
题解 | #格式化清单#
fruits_list = ['apple', 'ice cream', 'watermelon', 'chips', 'hotdogs', 'hotpot'] while True: fruits_list.pop(-1) if fruits_list != []: print(fruits_list) else: print(fruits_list) break
0
点赞
评论
收藏
分享
2023-09-13 14:42
题解 | #2的次方数#
def square(x): return 2 **x my_list = list(int(x) for x in range(1,11)) for i in list(map(square,my_list)): print(i)
0
点赞
评论
收藏
分享
2023-09-13 14:31
题解 | #被5整除的数字#
my_list = list(int(i) for i in range(1,51) if i % 5 == 0) for num in my_list: print(num)
0
点赞
评论
收藏
分享
1
2
3
关注他的用户也关注了:
牛客网
牛客企业服务