My Code seems functional and all but 18 and 19 have checked out. I have tried looking for suggestions on what may be the issue, but have not found anything.
Your code so far
distance_mi = 4
is_raining = True
has_bike = True
has_car = True
has_ride_share_app = True
if bool(distance_mi) == False:
print(False)
elif distance_mi <= 1 and not is_raining:
print(True)
elif 1 < distance_mi <= 6 and (has_car or has_ride_share_app):
print(True)
elif 1 < distance_mi <= 6 and has_bike and not is_raining:
print(True)
elif 1 < distance_mi <= 6 and is_raining and not has_bike:
print(False)
elif 1 < distance_mi <= 6 and not is_raining and not has_bike:
print(False)
elif distance_mi > 6 and (has_car or has_ride_share_app):
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/147.0.0.0 Safari/537.36
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner
If one of the conditions should be evaluated to the correct answer for these two tests, then one of the previous conditions must be catching it earlier.
you’re missing the next false statement after distance is less than 1 mile and its raining
elif distance_mi <= 1 and is_raining:
print(False)
the rest of the elif statements won’t work as written, they have to be broken down more.
elif distance_mi > 1 and distance_mi <= 6 and is_raining and not has_bike:
print(False)
elif distance_mi > 1 and distance_mi <= 6 and not is_raining and not has_bike:
print(False)
elif distance_mi > 1 and distance_mi <= 6 and has_bike and not is_raining:
print(True)
elif distance_mi > 6 and has_ride_share_app:
print(True)
elif distance_mi > 6 and has_car:
print(True)
elif distance_mi > 6 and not has_car and not has_ride_share_app:
print(False)
lastly, since all instances are covered above, your else statement isn’t needed so you can just delete it
Hi there. Thank you for the response. My elif statements work as they are. However, both the 1 > distance_mi <= 6 that should print False are not working. This is the only part of the code that is not working