lundi 20 avril 2020

Python : output does not match

when i executed the below code:

cars = ['bmw','audi','ferrari','jaguar']
for car in cars:
 if car == 'jaguar':
   print(car.upper())
else:
   print(car.title())

I was expecting the below output:

Bmw
Audi
Ferrari
JAGUAR

But I only get the output:

Jaguar
JAGUAR

Aucun commentaire:

Enregistrer un commentaire