Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

Step 15 works the first time, but then after everything’s added it just won’t work. Any solutions?

Your code so far

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

if not distance_mi:
    print(bool(False))

if distance_mi <= 1 and not is_raining:
    print(bool(True))
elif distance_mi <= 1 and is_raining:
    print(bool(False))

if distance_mi > 1 and distance_mi <= 6:
    if is_raining and not has_bike:
        print(bool(False))
    elif not has_bike and not is_raining:
        print(bool(False))
    elif has_bike and not is_raining:
        print(bool(True))

if distance_mi > 6:
    if has_ride_share_app:
        print(bool(True))
    elif has_car:
        print(bool(True))
    else:
        print(bool(False))


Your browser information:

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

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Hello @Kantoria !

The issue in your code is you do print False when distance_mi is falsy. (for example when distance_mi is 0) But you also validate the following condition :

because 0 <= 1 evaluate to True. So you’re printing False two time during the execution of your code when you should be only printing it once.

To fix this, you should be using either doing :

removed by moderator

Hope this helps.

Happy coding :slight_smile:

1 Like

mad respect to u twin :heart:

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.