题解 | 菜品的价格

菜品的价格

https://www.nowcoder.com/practice/86843c3ba8f240cda3bb2b177f896735

import sys


dict1 = {'pizza':10,'rice':2,'yogurt':5}

you_want_eat = input()

is_exist = 0
for i in dict1:
    if(you_want_eat == i):
        print(dict1[i])
        is_exist = 1
        break
if(is_exist == 0):
    print(8)

#exist or not exist,this is a question
    

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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