in を使う
1 2 3 4 5 6 |
dictsample = {'aa' : 0, 'bb' : 1} assert ('aa' in dictsample) == True assert ('bb' in dictsample) == True assert ('cc' in dictsample) == False |
いかがでしたでしょうか
in を使う
1 2 3 4 5 6 |
dictsample = {'aa' : 0, 'bb' : 1} assert ('aa' in dictsample) == True assert ('bb' in dictsample) == True assert ('cc' in dictsample) == False |