qq_57986857
2021-06-22 15:05
采纳率: 100%
浏览 24

推理-找出罪犯,求代码

 

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • CSDN专家-kaily 2021-06-22 15:17
    已采纳
    lst = ['a', 'b', 'c', 'd']
    for criminal in lst:
        if [criminal in ['b','c','d'], criminal == 'c', criminal in ['a','d'], criminal == 'c'].count(True)==2:
            print('The criminal is', criminal)
    点赞 打赏 评论

相关推荐 更多相似问题