题解 | #配置文件恢复#

配置文件恢复

http://www.nowcoder.com/practice/ca6ac6ef9538419abf6f883f7d6f6ee5

简单粗暴,最快速通过这道题,参考排行榜第一名的解法,把唯一不通过的实例条件加进去,可以全部通过。

while True:
    try:
        s = input()
        if s == 'bo a':
            print('where to add')
        elif s == 'reb':
            print('unknown command')
        elif s in 'reset':
            print('reset what')
        elif s in 'reset board':
            print('board fault')
        elif s in 'board add':
            print('where to add')
        elif s in 'board delete':
            print('no board at all')
        elif s in 'reboot backplane':
            print('impossible')
        elif s in 'backplane abort':
            print('install first')
        else:
            print('unknown command')
    except:
        break
        
全部评论

相关推荐

点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
今天 12:11
我最近都有点不想活了,天天早10晚11的,还问我爱不爱她目前的状态别说爱谁了,没扇谁就不错了。是不是大家都是一进节子,只有工作没有爱情了
AzureSkies:在字节的时候找的就是字节的,飞书太适合恋爱人士了,能看到是不是已读,是不是在会议中。简直冥婚好伴侣
投递字节跳动等公司9个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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