I have a quick question regarding if logic in python. I have the following code:
def punch(self):
"""Punch method that returns different remarks based on glove weight"""
if self.weight < 5:
return "That tickles."
elif self.weight >= 5 & self.weight < 15:
return "Hey that hurt!"
else:
return "OUCH!"
When I run the following code it always returns “Hey that hurt!”, no matter what weight I assign to self.weight. I am extremely confused as to why that is.