Tell us what’s happening:
please help i’m stuck in here, I don’t know what else to try
Your code so far
distance_mi = 50
is_raining = True
has_bike = True
has_car = True
has_ride_share_app = True
if distance_mi <= 50 and not is_raining and not has_bike:
print("True")
elif distance_mi >= 50 and not is_raining and not has_bike:
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/146.0.0.0 Safari/537.36
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner
1 Like
What are you stuck on. what errors are showing up in the terminal if any at all?
i don’t know what must i do
1 Like
19. 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.
So i copy pasted the code you have included in the post and ran the test and just looking at it I do not see where you have included code for number 19.
carefully read what the test is asking of you at 19 and the rest of the failed tests and write some code to account for them.
Reply to this again if you still have issues.
i still have an issue, number 15, i don’t know how to resolve it, here my code:
distance_mi = 0
is_raining = True
has_bike = True
has_car = True
has_ride_share_app = True
if distance_mi <= 1 and not is_raining:
print("True")
elif distance_mi >= 1 and distance_mi <= 6 and not is_raining and has_bike:
print("True")
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 >= 6 and has_ride_share_app:
print("True")
elif distance_mi >= 6 and has_car:
print("True")
else:
print("False")
1 Like
so you can check the truthy or falsy value by using the print(bool(distance_mi)) line at the bottom of the code. The test is not only looking for you to print false but it is checking whether the variable itself is a falsy value, >0 is truthy 0 is a falsy, <0 is truthy. you have to match the truthy or falsy value of the distance_mi with your print(‘True’) or print(‘False’) line of code. currently based on your reply, you have no rule set for a case of when the distance_mi is 0 to print False.