I’m having a problem in the 4th step; I am not able to define a falsy value, thereby not being able to move forward with the code.
Your code so far
distance_mi=3
is_raining = False
has_bike = True
has_car = False
has_ride_share_app = False
if is_raining:
print('how wil you be commuting?')
if has_bike:
print('commuting is possible!')
elif has_car or has_ride_share_app:
print('commuting is not possible')
else:
print('weather is clear!')
if distance_mi<=0:
print(False)
elif distance_mi<=1:
if not is_raining:
print(True)
else:
print(False)
elif distance_mi>1 and distance_mi<=6:
if has_bike==True and is_raining==False:
print(True)
else:
print(False)
else:
if 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/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner
facing problem in the 4th step i.e. ‘if distance_mi is a falsy value, print False’. please provide me with the correct code for the same.
Your code so far
distance_mi=3
is_raining = True
has_bike = True
has_car = True
has_ride_share_app = True
if is_raining:
print('how wil you be commuting?')
if has_bike:
print('commuting is possible!')
elif has_car or has_ride_share_app:
print('commuting is not possible')
else:
print('weather is clear!')
if distance_mi==0:
print(False)
elif distance_mi<=1:
if not is_raining:
print(True)
else:
print(False)
elif distance_mi>1 and distance_mi<=6:
if has_bike==True and is_raining==False:
print(True)
else:
print(False)
else:
if 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/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner