Exercise 19 

Write a program in Python that lists the strings that make up the list l = ["laptop", "iphone", "tablet", "printer", "Ipad"] by indicating the length of each string.

Solution

l = ["laptop", "iphone", "tablet", "printer", "Ipad"]
#browse and read all the items in the list l
for x in l:
print(x, " is in list l, its length is: ", len(x))
Younes Derfoufi
One thought on “Exercise 19 Solution”

Leave a Reply