## Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today. # Python Basic last challange

I can't figure it out and it'd be nice to have a proper example this time. I've already asked for help but the hints didn't help me a lot :P

Question : Make a while loop that runs until start is falsey. Inside the loop, use random.randint(1, 99) to get a random number between 1 and 99. If that random number is even (use even_odd to find out), print "{} is even", putting the random number in the hole. Otherwise, print "{} is odd", again using the random number. Finally, decrement start by 1.

even.py
```import random
num = random.randint(1, 99)
start = 5

guess = int

def even_odd(num):
if guess == secret:
print("{} is even".format(num)
else:
print("{} is odd".format(num)

# If % 2 is 0, the number is even.
# Since 0 is falsey, we have to invert it with not.
return not num % 2

while len(start) False:
else:
if start == False:
break
```

Okay so you have a few problems here.

First, you don't need to change the definition of the `even_odd` function, so don't put any code in that block.

Second, you need to set the value of `num` inside the loop using the `random.randint` method so it will use a different value for each iteration.

Third, when it says to "Make a `while` loop that runs until `start` is falsey.' it just means:

```while start:
# loop code goes here
```

Because you have to decrement `start` inside the loop, it will eventually reach zero and that is considered 'falsey', at which point the loop will stop.

Fourth, you need to use the `even_odd` function inside the loop and as part of an `if` conditional. e.g.

```if even_odd(num):
# code to run if num is even
else:
# code to run if num is odd
```

Fifth, you don't need `guess` or `secret`.

And lastly, be careful that you are consistent with your indentation. Use either 2 or 4 spaces for each level of indentation, where possible. I think at some point Kenneth talks about the PEP 8 style guide/convention, which helps to keep your Python code consistent and clean.

Just set `start` equal to the value of `start` minus 1:

```start = start - 1
```

Or with the shorthand form:

```start -= 1
```

I didn't really want to just give you the answer, but here it is:

```import random

start = 5

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

while start:
num = random.randint(1, 99)

if even_odd(num):
print('{} is even'.format(num))
else:
print('{} is odd'.format(num))

start -= 1
``` 