Hello
I am not able to resolve step 21 and 23. The moment I change to have a different approach, all the steps get reset even if most of the code is same.
Your code so far
distance_mi = 11
is_raining = True
has_bike = True
has_car = False
has_ride_share_app = True
if distance_mi == 0:
print('False')
elif distance_mi <= 1 and not is_raining:
print('True')
elif distance_mi <= 1 and is_raining:
print('False')
elif 1 > distance_mi or distance_mi <= 6 and is_raining and not has_bike:
print('False')
elif 1 > distance_mi <= 6 or not is_raining and not has_bike:
print('False')
elif 1 > distance_mi <= 6 or 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 or has_ride_share_app):
print('False')
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) 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
Does the output change? If it changes, then the logic before the check for a ride share app is activated. In that case, the output is not dependent on the ride share app.
You current code will fail because of the where the check for the is_raining variable is located.
Think of it as, you go to room one, nothing inside, you go to room two find a map, you go to room three step inside and fall down a hole because the room was dark. There is a torch in room four, but you’ll never get to it.
I’ve edited your post to improve the readability of the code. When you enter a code block into a forum post, please precede it with three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add the backticks.