samedi 25 novembre 2017

Python if statement runs even if false

I am trying to do a Reddit challenge but i seem to have gotten stuck on an if statement that plays even when false.Screen shot of it happening

type1 = input()
type2 = input()
if type1[:3] == 'nor':
    if type2[:3] == 'nor'or'fir'or'wat'or'ele'or'gra'or'ice'or'fig'or'poi'or'gro'or'fly'or'psy'or'bug':
        print('Normal 100% Damage')
    elif type2[:3] == 'roc' or 'ste':
        print('Not very effective 50% Damage')
    elif type2[:3] == 'gho':
        print('No effect 0% Damage')
    else:
        print('Not a valid type')

Aucun commentaire:

Enregistrer un commentaire