
Matte Matt
2,354 PointsI have done everything right, but it tells me I have the wrong number of prints??
It says I have too many prints, but I have two and the question is ASKING FOR TWO!
What do I do?
import random
def even_odd(num):
# If % 2 is 0, the number is even.
# Since 0 is falsey, we have to invert it with not.
return not num % 2
start = 5
while even_odd(start) == False:
ranNum = random.randint(1,99)
if even_odd(ranNum) == True:
print("{} is even".format(ranNum))
else:
print("{} is odd".format(ranNum))
start = start - 1
1 Answer

behar
10,783 PointsHey Matte! Indeed you have not done everything right, if this was the case you would pass :P
It says I have too many prints, but I have two and the question is ASKING FOR TWO!
No? Where did you read this. It says to run the while loop until start is 0. That was the whole point of having the start variable. Fix that and youll pass, happy coding!