Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

I am try to solve the all problems by breaking the problems yeah it work but i think this is so much code i guess for this i think conditions can we improve in one line but yeah it work

Your code so far

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

if not distance_mi:
    print(False)
elif distance_mi <= 1 and is_raining != True:
    print(True)

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 != True):
    print(True)

elif distance_mi > 1 and distance_mi <=6 and (has_bike == False and is_raining == True):
    print(False)

elif distance_mi >6 and (has_car == True or has_ride_share_app == True):
    print(True)

elif distance_mi >6 and (has_car != True and has_ride_share_app != True):
    print(False)

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/150.0.0.0 Safari/537.36

Challenge Information:

Build a Travel Weather Planner - Build a Travel Weather Planner

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-travel-weather-planner/694acade1d4afdbce71e5840.md at main · freeCodeCamp/freeCodeCamp · GitHub

Welcome to the forum @vijaypsharma,

It sounds like you are asking for feedback on your code. We have blurred this solution (with [spoiler][/spoiler] tags) so that users who have not completed this challenge can read the discussion in this thread without giving away the solution.

Happy coding