Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

Hi,
This code won’t pass step 15 (When the distance is 1 mile or less, and it is not raining, the program should print True.):

elif distance_mi <= 1 and not is_raining:
print(“True”)

It literally says so, but that’s not enough, obviously. I don’t get why.

Your code so far

distance_mi = 1
is_raining = False
has_bike = True
has_car = False
has_ride_share_app = True

if not isinstance(distance_mi, int):
    print("False")
elif distance_mi <= 1 and not is_raining:
    print("True")
#elif distance_mi <= 1 and is_raining:
#    print("False")
elif 1 < distance_mi <= 6 and has_bike and not is_raining:
    print("True")
elif 1 < distance_mi <= 6 and not has_bike and not is_raining:
    print("False")
elif not 1 < distance_mi > 6 and not has_bike and is_raining:
    print("False")
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; rv:147.0) Gecko/20100101 Firefox/147.0

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

What is distance_mi is 0?

If distance is 0, it prints out “True”.
Shouldn’t it?

Please review User Story #4.

I removed the validation part at the beginning, and somehow it passed.

yeah, consider how many distances that are that are less than 1 mile, like 0.4 miles

Validation is now back, this time to check two types instead of one - and it works. Thank you!