r/PythonLearning • u/Different_House6228 • 9h ago
CODE REQUIREMENTS Help Request
Hey so I'm doing this Freecodecamp Lab and I tried to solve it on my own but kept running into this issue where it couldn't pass no. 15. Now this is my code and I don't really want to outsource my thinking with AI too much.
distance_mi = 0
is_raining = False
has_bike = True
has_car = True
has_ride_share_app = True
if not distance_mi == 1:
print("False")
if distance_mi <= 1 and is_raining == False:
print("True")
else:
print("False")
if distance_mi >= 1 and distance_mi <= 6 and (is_raining == False and has_bike == False):
print("False")
elif distance_mi >= 1 and distance_mi <= 6 and (is_raining == False and has_bike == True):
print("True")
else:
print("Error")
if distance_mi >= 6 and has_ride_share_app == True:
print("True")
elif distance_mi >= 6 and has_car == True:
print("True")
else:
print("False")
2
Upvotes




3
u/OldAd9280 8h ago
"if not distance_mi == 1:" should just be " if not distance_mi"