0

How to code python to print words from my list L with 5 letters only using for and len?

L = ['first', 'second', 'third', 'fourth', 'fifth']

16th Sep 2018, 11:36 AM
dr POP
dr POP - avatar
4 odpowiedzi
+ 4
L = ['first', 'second', 'third', 'fourth', 'fifth'] for word in L: #print(word[:5]) # this works too if len(word) == 5: print(word)
16th Sep 2018, 12:32 PM
Ipang
16th Sep 2018, 12:37 PM
Shruti
Shruti - avatar
+ 1
Thx to Ipang, he competely imderstood and resolve my problem with using for and len. I had to primt just 5 letter words, first, third, fifth, not secon and fourt. Thx again! We'll be in touuch.
16th Sep 2018, 3:17 PM
dr POP
dr POP - avatar
0
sorry, understood
16th Sep 2018, 3:17 PM
dr POP
dr POP - avatar