I’m trying to make an age calculator that is accurate enough to calculate age based on whether the person has had their birth day this year or not.
The problem is something is wrong with my code so even thought when I input “No” it should deduct -1 from the age result but it doesn’t do this.
This is the code that I have wrote so far
Advertisement
Answer
upper()
makes your text upper case. So the result just can’t be ‘No’. It should be ‘NO’. Also, I recommend you to read about is
and ==
.