Build a Travel Weather Planner - Build a Travel Weather Planner

Hello everyone, I need help about this Lab. I made the first part but I cannot watch what’s wrong. I have a great OK till 14 but I don’t know, I’m feeling low. Here’s my code:

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

if distance_mi ==0:
    print("False")
elif distance_mi <=1 and is_raining==False:
    print("True")
else:
    print("False")

if distance_mi >1 and distance_mi <=6 and (has_bike==True and is_raining==False):
    print("True")
else:
    print("False")

if distance_mi > 6 and (has_car==True or has_ride_share_app==True):
    print("True")
else:
    print("False")

Thanks on advance.

Welcome to the forum @David8A

When I delete lines 14 and below from the editor, only three users stories fail.

Happy coding

consider that with your code there will always be three things printed, is this what you are asked to do?

when there is a specific distance you are asked to print one specific thing, not three

Sorry, I understood that the program reads each line of code until it executes the one that is correct for the given conditions.
I’m new to all this, and I don’t really understand how it works. Could you explain it to me (not give me the solution), please?
Because in my mind, it seems that it will read each one and ignore the others when the appropriate code is found for execution.

if you run the code with this you can follow along with the code execution: https://pythontutor.com/

if you have any questions about what you see, feel free to ask


what I mean was that, the first failed test is:

When the distance is 1 mile or less and it is not raining, the program should print True .

so let’s set distance_mi=0.5 and is_raining=False

in the terminal we see

True
False
False

you are asked to print True, do you think that maybe True False False is too much stuff?

Gotcha!

And answering to you: Yep, that was too much stuff for me. Man this is completely strange for me right now.:sweat_smile:

God bless you for the help, pal. :slight_smile:

you are learning, you will get better as long as you keep at it!