Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening: I’m not able to get the concept

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

if distance_mi <= 1 and is_raining == False:
print(‘False’)
elif distance_mi <= 1 and is_raining == True:
print(‘False’)
elif distance_mi < 1 and distance_mi <= 6 and has_bike == True and is_raining == False:
print(‘Enjoy your ride’)
elif distance_mi > 6 and has_car == True and has_ride_s

Your code so far

#distance_mi = 0
#is_raining = True
#has_bike = True
#has_car = True
#has_ride_share_app = True

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


if distance_mi <= 1 and is_raining == False:
    print('False')
elif distance_mi < 1 and distance_mi <= 6 and has_bike == True and is_raining == False:
        print('Enjoy your ride')
elif distance_mi > 6 and has_car == True and has_ride_share_app == True:
    print('Enjoy your ride')
else:
    print('True')    

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 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

why are you printing this? please follow the user stories on what should be printed

1 Like

sorry , it seems i misunderstood somethings in the instructions

i hope this is the correct logic and order ;

distance_mi = 7

is_raining = False

has_bike = False

has_car = False

has_ride_share_app = False

if distance_mi == 0:

print('False')

elif distance_mi <= 1 and not is_raining :

print('True')

elif 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')

does it pass the tests?

yes it did passed the test , i still need to revise , btw thanks for the help

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.