题解 | #查字典#

查字典

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

alph = {
    "a": ["apple", "abandon", "ant"],
    "b": ["banana", "bee", "become"],
    "c": ["cat", "come"],
    "d": "down",
}
user_input = input()

if isinstance(alph[user_input],list):
    for element in alph[user_input]:
        print(element,end = " ")
    print()
else:
    print(alph[user_input])

全部评论

相关推荐

嵌入式的小白:简历关键的就是项目经历,你这密密麻麻的,我一点开就不想看了,每一条都不换行,而且每一个里面写那么多,需要精简一下,这样别人看一眼就能知道你做了啥,用了啥技术
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务