Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

My code doesn’t pass the lab test from 15 to 23 . I am kind stuck with this for long hours .so someonle please help me to correct the code.

Your code so far

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

if has_bike and not is_raining:
    print("You can commute by bike ")
elif has_car :
    print("You can commute by car")
elif has_ride_share_app:
    print("you can commute by sharing a ride")
else:
    print("commuting is impossible")

if not distance_mi :
    print('False')
    

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

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

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Mobile 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 @Cinder,

Please organize your code so it prints only one thing – either True or False.

In User Story #3 it says to:

use if, elif, and else statements to evaluate the distance categories in ascending order.

And the following user stories show the order based on the value of distance_mi.

Happy coding

Thanks for Your help ,finally my code passed