Tell us what’s happening:
“Lorsque la valeur de " distance_mi” est fausse, le programme doit afficher False". Je ne sais pas comment écrire ce code en python
Your code so far
distance_mi = 30
is_raining = False
has_bike = True
has_car = False
has_ride_share_app = False
if is_raining and has_bike :
print ("Je peux aller au travail")
if has_ride_share_app and not (has_car or is_raining):
print("Je peux aller")
if has_car and has_bike and not(is_raining) :
print("je ne peux pas aller")
if has_car and has_ride_share_app and not(is_raining):
print ("Je ne peux pas aller au travail")
if distance_mi == [0,5]:
print("Je peux y aller à velo")
elif distance_mi == [5,10] :
print("Je peux aller à voiture si j'en ai")
else :
print("J'utiliserai un Rise Share app")
if distance_mi != [0,30]:
print("False")
if distance_mi <= 1 and is_raining:
print("True")
else :
print("False")
if distance_mi > 1 and distance_mi <= 6:
print("Est-ce qu'il pleut et est-ce que j'ai un vélo")
elif is_raining and has_bike:
print("True")
else :
print("False")
if distance_mi > 6 :
print("Est-ce qu'il a voiture ou est-ce qu'il utilise une app")
elif not(has_car) and not(has_rise_share_app):
print("True")
else:
print("False")
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Challenge Information:
Build a Travel Weather Planner - Build a Travel Weather Planner