Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

im stumped on steps 17-19. tbh this whole boolean conditionals is really difficult to understand as far as how the pieces link together. i get the HOW but not the WHY. or i guess somewhere in between that LOL

Your code so far

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

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

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Welcome to the forum @livingfields!

What does your code print when distance_mi is 0.5?

Happy coding!

i tried that just now and it still printed True in the console :sob:

Won’t this always print True if distance_mi is truthy? Try adding some extra prints inside the if code blocks to see where your code is going with different values.

i rewrote my code because it was a mess and i think i understand a bit better. my original post was messy. also the wonders of code you fix something and break something else :sweat_smile:

If you still need help, please post your code. (We can’t test with a screenshot.)

When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add the backticks.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

oh thank you i didnt know that im very new here, thank you for your patience and help

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

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

else:
    print()
if distance_mi>6 and has_car =='True':
    print:('True')
else:
    print()
distance_mi=0.5
is_raining=False
has_bike=True
has_car=True
has_ride_share_app=True

if distance_mi == bool(distance_mi):
    print("in boolean")
    print('False')
elif distance_mi <= 1 and is_raining == 'False':
    print("in <=1 no rain")
    print('True')
elif distance_mi <= 1 and is_raining == 'True':
    print("in <= 1 rain")
    print('False')

else:
    print("in else")
if distance_mi>6 and has_car =='True':
    print("in >6 and car")
    print:('True')
else:
    print("in >6 else")

See how I’ve added print statements throughout your code to debug? Try testing with different values to see if your code is going where you think is should. And make sure you are meeting the requirements for all of the user stories.

removed by moderator

thank you so much for your help. it finally clicked!!!

Congratulations on solving the challenge! You should be proud of your achievement…we are! But we are removing your working solution, so it is not available to others who have not yet done the work to get there. Again, congrats!

oops my bad you right :sweat_smile: thank you for helping me around