I am passing every test except 18 and 19 which, since both of them have to do with the condition between 1 mile and 6 miles, I am guessing has to do with the way I wrote the “between” statement:
I have no errors in the console so there is nothing wrong with the code as far as python in concerned, but 18 and 19 are not passing in the “Tests” section. It does appear to be printing the correct statement (True or False) in the console though.
Your code so far
distance_mi = 5
is_raining = False
has_bike = False
has_car = False
has_ride_share_app = False
if not distance_mi:
print("False")
elif distance_mi <= 1 and not is_raining:
print("True")
elif distance_mi > 1 and distance_mi <= 6 and has_bike and not is_raining:
print("True")
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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Safari/605.1.15
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner
are you asked to print True everytime that has_ride_share is True?
this is what happens with the condition (distance_mi > 6 and has_car) or (has_ride_share)
I have run the test on the line of code that is distance_mi >6 and has_ or has_ride_share_app dozens of times and there is nothing wrong with that part of the code. Once again, the part of the code that is having issues is the one with the statement distance is between 1 and 6 miles.