HELLO, SORRY FOR MY LAST POST I SAID SOMETHING LIKE “I DID EVERYTHING RIGHT”, AND I GOT HUMBLED ABOUT IT BECAUSE I DIDN’T
CAN SOMEONE HELP ME FIGURE OUT WHY STEP 16 DOESN’T GIVE ME THE APPROVE SIGN? THANKS IN ADVANCE
Your code so far
distance_mi = 20
is_raining = True
has_bike = False
has_car = False
has_ride_share_app = True
if not isinstance(distance_mi, int):
print(True)
elif distance_mi <= 1:
if is_raining == False:
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)
elif distance_mi >= 6:
if has_car == True:
print(True)
elif has_ride_share_app == True:
print(True)
else:
print(False)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner
HELLO, SORRY FOR MY LAST POST I SAID SOMETHING LIKE “I DID EVERYTHING RIGHT”, AND I GOT HUMBLED ABOUT IT BECAUSE I DIDN’T
CAN SOMEONE HELP ME FIGURE OUT WHY STEP 16 DOESN’T GIVE ME THE APPROVE SIGN? THANKS IN ADVANCE
Your code so far
distance_mi = 20
is_raining = True
has_bike = False
has_car = False
has_ride_share_app = True
if not isinstance(distance_mi, int):
print(True)
elif distance_mi <= 1:
if is_raining == False:
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)
elif distance_mi >= 6:
if has_car == True:
print(True)
elif has_ride_share_app == True:
print(True)
else:
print(False)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner
@pkdvalis is asking you to test your code with different scenarios to see if you are printing the expected values. Learning how to debug your own code is an important developer skill.
Does it make sense to print true if distance is not an integer? And what if distance is 0? That’s an integer, but is it truthy?
The goal of this challenge is to help you hone your logic and reasoning skills, so do your best to organize the instructions into the necessary if/elif/else statement(s).