题解 | #发送offer#

发送offer

http://www.nowcoder.com/practice/66969869634b4142ac371684fcf89764

offer_list=['Allen','Tom']
for i in offer_list:
    print('{}, you have passed our interview and will soon become a member of our company.'.format(i))

offer_list.remove('Tom')
offer_list.append('Andy')
for j in offer_list:
    print('{}, welcome to join us!'.format(j))

全部评论
you和welcom之前没有空格
1 回复 分享
发布于 2022-08-21 17:45 陕西
replace只能用在字符串,这里是列表
3 回复 分享
发布于 2023-02-03 21:07 河南
为啥不能用.replace('Tom','Andy')呢,用了之后会报错
2 回复 分享
发布于 2022-11-14 07:32 山东
为啥说我格式不正确呢... offer_list=['Allen','Tom'] for i in offer_list: print('%s,you have passed our interview and will soon become a member of our company.'%i) offer_list.remove('Tom') offer_list.append('Andy') for j in offer_list: print('%s,welcome to join us!'%j)
1 回复 分享
发布于 2022-07-12 21:47
offset_list=['Allen','Tom'] for i in offset_list: print(i+',you have passed our interview and will soon become a member of our company.') offset_list.remove('Tom') offset_list.append('Andy') for j in offset_list: print(j+',welcome to join us!') # 我这样写不行吗,为啥也说我格式不对呢
点赞 回复 分享
发布于 2022-08-06 16:10
提交显示错误 offer_list=['Allen','Tom'] for i in offer_list: print('{}, you have passed our interview and will soon become a member of our company.'.format(i)) offer_list.remove('Tom') offer_list.append('Andy') for j in offer_list: print('{}, welcome to join us!.'.format(j)) 怎么办?
点赞 回复 分享
发布于 2022-08-25 14:45 江苏
注意英文逗号后面要有空格,不然会报错。
点赞 回复 分享
发布于 2023-06-10 14:31 广东
这里要有input()输入Andy吧不然提交不上去这样Andy是全局变量得改代码才可以换人
点赞 回复 分享
发布于 2023-10-16 13:20 辽宁
为啥一个人input()的都没有写出来就报错我想参考一下没一个人写的
点赞 回复 分享
发布于 2023-10-16 13:21 辽宁

相关推荐

Noob1024:一笔传三代,人走笔还在
点赞 评论 收藏
分享
点赞 评论 收藏
分享
91 2 评论
分享
牛客网
牛客企业服务