Build a Travel Weather Planner

Raccontaci cosa sta succedendo:

Hello, I can’t resolve this test cause instances 21 and 22 are Always giving me errors.

Il tuo codice finora

distance_mi = 7
is_raining = True
has_bike = True
has_car = True
has_ride_share_app = True

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


    
    




    






    


    



Informazioni sul tuo browser:

User Agent è: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Mobile Safari/537.36 (Ecosia ``android@152.0.0.0``)

Informazioni sulla sfida:

Crea un pianificatore meteo per viaggi - Build a Travel Weather Planner

Collegamento GitHub: i18n-curriculum/curriculum/challenges/italian/blocks/lab-travel-weather-planner/694acade1d4afdbce71e5840.md at main · freeCodeCamp/i18n-curriculum · GitHub

Welcome to the forum @alex94,

User stories 5 through 8 all talk about using distance to write your conditions, but you are only checking the distance in two of your conditions.

Happy coding

consider this

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

which condition does this match?

Sorry, but I don’t understand

Now I have an error only on the 15th story

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

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

if distance_mi == 0:
print(False)
elif distance_mi == 0.0:
print(False)
elif distance_mi == False:
print(False)
elif distance_mi == “”:
print(False)

please post your code properly formatted, it has lost indentation

There are two ways you can format your code to make it easier to read and test:

  1. After you copy/paste your code into the editor, select it by dragging your cursor over it then click the (</>) button in the toolbar to automatically wrap your code in backticks. (You can click on the animated demo image below to enlarge it.)

  1. Manually add three backticks on a new line above your code and on a new line after your code. Note that a backtick is NOT the same as a single quote('). To find the backtick key on your keyboard, see this post.

To see changes to your post as you make them, you can click the (M+) button on the toolbar to bring up the rich text editor: