Tell us what’s happening:
When distance_mi is a falsy value, the program should print False.
i have been stuck with thsese code for two weeks now can anyone help please
Your code so far
distance_mi=0
is_raining=False
has_bike=True
has_car=False
has_ride_share_app=True
can_commute=False
if has_car:
can_commute=True
print('commute is possible by driving')
elif has_bike and not is_raining:
can_commute=True
print('commute is possible by biking')
elif distance_mi < 2 and not is_raining:
can_commute=True
print('commute is possible by walking')
elif has_ride_share_app:
can_commute=True
print('commute is possible via ride_share_app')
else:
can_commute=False
print('False')
if distance_mi < 2:
if not is_raining:
print('commute is possible: walking')
elif has_car or has_ride_share_app:
print('commute possible: car or ride_share_app')
else:
print('commute not possible: too wet to walk')
elif distance_mi < 10:
if has_bike and not is_raining:
print('Commute possible:Biking')
elif has_car or has_ride_share_app:
print('commute possible:car or ride share app')
else:
print('commute not possible')
else:
if has_car or has_ride_share_app:
print('commute possible:car or ride share app')
else:
print('commute not possible:Too far')
if distance_mi==False:
print('False')
if 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36 Edg/147.0.0.0
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner