Solution Exercice 19: lister les éléments d'une liste en python

Exrcice 19

Ecrire un programme en Python qui permet de lister les chaines qui composent la liste l = ["laptop", "iphone", "tablet"] tout en indiquant la longueur de chaque chaine.

Solution

l = ["laptop", "iphone", "tablet", "printer", "Ipad"]
# parcourir les éléments de la liste  l
for x in l:
    print(x, " is in list l, its length is: ", len(x))

 

 

Younes Derfoufi
CRMEF OUJDA

2 thoughts on “Solution Exercice 19: lister les éléments d'une liste en python

Leave a Reply

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock