Build a travel weather planner

I have been trying to solve this for the past 2 hrs, not using ai, “I’m here to learn without it”

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

if not distance_mi:
    print(False)
elif not is_raining :
    if distance_mi >= 1 :
        print(True)
    elif distance_mi <=1 :
        print(True)
    else :
        print(False)

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

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

tried all sorts of expanding code and shrinking but the 19th and 23rd condition always remain failed
I’ll put them here for your convenience :slight_smile:

  1. When the distance is between 1 mile (excluded) and 6 miles (included), it is not raining but no bike is available, the program should print False.

23.When the distance is greater than 6 miles and no car nor a ride share app is available, the program should print False.

Welcome to the forum @Optimistic420!

If you set is_raining to False, will your code ever get to the last two elif blocks regardless of the value of distance_mi? Put some print statements in your elif blocks (like print("in > 6")) to test that.

Happy coding!

Thank You I can understand the conditioning error