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
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)
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:
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.)
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: