题解 | #字典新增#

字典新增

https://www.nowcoder.com/practice/a69d651105ee4cfd86c56418f0aa9de3

import sys

dictionary = {
    "a": ["apple", "abandon", "ant"],
    "b": ["banana", "bee", "become"],
    "c": ["cat", "come"],
    "d": "down",
}
letter = input()
word = input()
for i in list(dictionary):
    if letter == i:
        dictionary[i].append(word)
        break
    else:
        dictionary[letter] = word

print(dictionary)
for line in sys.stdin:
    a = line.split()
    print(int(a[0]) + int(a[1]))

全部评论

相关推荐

11-08 17:36
诺瓦科技_HR
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务