I keep running into error 15 and 20, Not sure how to fix this.
15. When distance_mi is a falsy value, the program should print False.
20. When the distance is between 1 mile (excluded) and 6 miles (included), a bike is available, and it is not raining, the program should print True.
Your code so far
distance_mi=7
is_raining=False
has_bike= True
has_car= False
has_ride_share_app= True
if distance_mi <= 1:
if not is_raining:
print('True')
else:
print('False')
elif 1> distance_mi <=6:
if has_bike and not is_raining:
print('False')
else:
print('True')
elif distance_mi > 6:
if has_car or has_ride_share_app :
print('True')
else:
print('False')
else:
print('False')
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner
if distance_mi==0:
print('False')
if distance_mi <= 1:
if not is_raining:
print('True')
else:
print('False')
elif 1< distance_mi <=6:
if has_bike and not is_raining:
print('True')
else:
print('False')
elif distance_mi > 6:
if has_car or has_ride_share_app :
print('True')
else:
print('False')
else:
print('False')
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.