Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

My code is failing tests 17-22 for this exercise and I cannot figure out why. It seems to me that I am checking all of the specific conditions that are being asked but I must be missing something. Could anyone help out?

Your code so far

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

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

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

distance_mi = 7     #test the below condition
if 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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

Try to organize your if/elif/else statements so you only print once.

Please change the value of this variable at the top of your code to test this condition.

1 Like

Thank you! I didn’t realize that I was required to only print once. I thought it was supposed to print 1 result per condition.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.