Build a Travel Weather Planner - Build a Travel Weather Planner

Tell us what’s happening:

The code does run and return a single value however, it seems that it is not correct I am not sure how to write the if statement for greater than 1 and less than or equal to 6 correctly would I write multiple? or is there something else I am missing?

Your code so far



distance_mi = 15

is_raining = False

has_bike = False 

has_car = True

has_ride_share_app = True 



if distance_mi <= 1 and is_raining:
    print(False)

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


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

Hi @kalpottsart

17. When the distance is between 1 mile (excluded) and 6 miles (included), and it is raining with no bike, the program should print False.

To help you debug, run your program with 5 miles, raining, and no bike.

Happy coding

Hi there,

Try to use if, elif, and else statements for this challenge.

Does this code meet the requirements?

You might find it easier to manage this if you organize your code to handle everything that should print True first.

And don’t forget that distance_mi should be a truthy value.

Good luck!