Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I cannot get test 15 to pass, even though when I put the distance variable to a falsy value it returns false

Your code so far

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

if bool(distance_mi) == False:
    print(False)

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




Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0

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

You are printing others after print False if distance_mi is falsy value.
You need to add else, and move others code to else block.

Welcome to the forum @eljeffe,

Try testing with distance_mi = 0. Your code should only print one thing in the console – either True or False. But in this case, your code logs:

False
True

Happy coding

I have the same problem as you. I spent almost 2 hours on this project, and i found solutions for this

code removed by moderator

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge. How to Help Someone with Their Code Using the Socratic Method

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.