I'm just learning python and am having trouble understanding why my if input is triggering my else statement. I'm sure I'm missing something basic here but would like someone to look at it! Essentially, when I am inputting one of my variables it is dragging the else statement into it. I'm attaching the code, thanks for having a look!
n = 'Nike'
p = 'Puma'
a = 'Adidas'
boot = input('What is your favorite boot?')
if boot == n:
print('Nike, great choice')
if boot == a:
print('Adidas, not my favorite')
if boot == p:
print('Not sure about Puma')
else:
print('I am not familiar with that brand')
Typing in Nike
on the input prints
Nike, great choice.
I'm not familiar with that brand.
Aucun commentaire:
Enregistrer un commentaire