Tell us what’s happening:
15
Changed distance to 0 and it stayed true. Not sure what I’m doing wrong. Read the geeksforgeeks link from another forum post and still confused. Does else: print(“False”) not qualify for this?
17, 18, 19
I’ve looked over my code and read the forum posts and still can’t figure out what’s wrong.
23
I’ve tried “and” and “or” between has_car has has_app.
I hope this is enough details. I’ve been working on this a few days and struggling.
Your code so far
distance_mi = 43.8
is_raining = False
has_bike = True
has_car = True
has_ride_share_app = False
if distance_mi:
print("True")
elif distance_mi <= 1 and not is_raining:
print("True")
elif distance_mi <= 1 and is_raining:
print("False")
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 (1 > 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 > 6 and not has_car and not has_ride_share_app:
print("False")
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/152.0.0.0 Safari/537.36
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner