Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I am having trouble with 19 and 23. I just cant seem to get it. for 18 it has to be between 1 mile and 6 miles and raining with no bike.

Your code so far

distance_mi = 60
is_raining = True
has_bike = True
has_car = True
has_ride_share_app = True
if not distance_mi:
    print('False')
elif distance_mi <=1 and is_raining:
    print('False')
elif distance_mi <= 1 and is_raining == False and has_bike == True:
    print("True")
elif distance_mi >1 and distance_mi <=6 and is_raining == False and has_bike == True:
    print('True')
elif distance_mi >1 and distance_mi <=6 and has_bike == False and is_raining == False:
    print('False')
elif distance_mi >6 and has_car == True or has_ride_share_app == True:
    print('True')
elif distance_mi <=1 and is_raining == False:
    print('True')
elif distance_ >=1 and distance_ >=6 and is_raining == False:
    print('Fasle')
  

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

you have this typo

the other thing you need to consider is your use of or operator
when you have or, it wants a full expression on each side, and if you use it together with and, then and acts first

that means if you have a thing like A and B or C, what happens is actually (A and B) or (C)

I fixed the typo thanks for that.

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