###### Rujuta Shinde

1,712 Points# what is wrong number of prints

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 start == 0: num = random.randint(1,99) if even_odd(num) == True: print("is even") else: print ("is odd") start = start-1

```
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 start == 0:
num = random.randint(1,99)
if even_odd(num) == True:
print("is even")
else:
print ("is odd")
start = start-1
```

## 3 Answers

###### Steven Parker

195,447 PointsIf you look at these two lines:

```
start = 5
while start == 0:
```

You can see that "start" will be 5 when the loop tests to see if it is equal to 0, so the loop will never run.

You could change the comparison, but even easier than that is to take advantage of the fact that a number that is not zero is considered "truthy" and just test it by naming it:

```
while start:
```

Similarly, you never have to compare anything to "True" — you can just name it.

###### Rujuta Shinde

1,712 Pointsimport 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 start: num = random.randint(1,99) ans= even_odd(num) if ans == 0: print("{} is even".format(num)) else: print ("{} is odd".format(num)) start = start-1

This too gives an incorrect answer Some or all of your prints are wrong

###### Steven Parker

195,447 PointsYou have changed the way you call and test the "even_odd" function. Since it always returns a boolean response (True or False), it will never equal 0.

The original code only needed the "while" fixed to pass. The other comment I made about never needing to compare anything with "True" could be implemented like this:

```
if even_odd(num):
```

###### Rujuta Shinde

1,712 PointsThanks! that helped