Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I’m kind of confused about the falsy value part. I’m just not understanding why the distance would need to be equivalent to zero. I’m also confused about step 17. For 17 am I supposed to change the variable to equal True for the system to check it off the list?

Your code so far

distance_mi = 4
has_bike = False
has_car = False
is_raining = False
has_ride_share_app = True

if distance_mi == 0:
    print('False')
if distance_mi <= 1 and is_raining:
    print('False')
if distance_mi <= 1:
    print('True')
elif distance_mi <= 6:
    print('False')



Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36 Edg/146.0.0.0

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Another thing I find confusing is step 20. I’m not sure on how to put it. It says this, “When the distance is between 1 mile (excluded) and 6 miles (included), a bike is available, and it is not raining, the program should print True.” The bolded part especially confuses me because I don’t know how to do that.

Hi @tenzin.deck ,

Please organize your code so it only prints one thing. For example, if distance_mi is 0, your code prints both False and True. You can, and should, use all of the if/elif/else components in your code.

You should use if, elif, and else statements to evaluate the distance categories in ascending order.

Regarding falsy values, there are more of those than just 0. Refer to this reference to check that out:

No, is_raining will evaluate to True or False as is. You don’t need to say is_raining == True.

Regarding Test #20, you can use the and and or operators to put your logic into one if statement.

Finish your code. Take it slowly a step at a time, changing the values to test as you go.

Happy coding!