Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

Hi, I’ve got everything done but printing False when distant_mi has a false value drives me crazy. I think the else at the end should satisfy th requirement but obviously I’m wrong.

Your code so far

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

if distance_mi <= 1 and not is_raining:
    print(True)
elif distance_mi > 1 and distance_mi <= 6 and has_bike and not is_raining:
    print(True)
elif distance_mi > 6 and (has_car or has_ride_share_app):
    print(True)  
else:
    print(False)


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-travel-weather-planner/694acade1d4afdbce71e5840.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @zv8n9gpz77,

See if this reference helps you get your head around the falsy thing:

Truthy vs Falsy Values in Python - GeeksforGeeks

Happy coding

If distance_mi is a falsy value:

  • You should print False.

But there’s no part in your code. You can check it at the beginning of the if statement.