Build a Travel Weather Planner

I’m stuck trying to satisfy instruction 16

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

if distance_mi == False or distance_mi == True:
    print(False)

elif distance_mi <= 1 and is_raining == False: #This is where it says my problem is.
        print(True)
    
elif distance_mi > 1 and distance_mi <= 6 and is_raining == True and has_bike == False:
        print(False)

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

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

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

Lesson URL (copy - paste from your browser’s address bar)

Welcome to the forum @Sonnyboy123,

What is the purpose of this code?

Happy coding

  1. If distance_mi is a falsy value:
    • You should print False.

I’m sure this is the wrong way to do this but it satisfies the training module.

Step 16 says:

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

But you are using the OR operator to also check if distance_mi is True.

Please take a look at this reference to understand more about falsy values and how to check for them:

Happy coding