Hi sir/ma’am, while i was writing my code i had previous practice problems in my mind and hence i used the range and len function in my code. However, when i checked the answer it was very simple. how to decide when to use and when to keep it simple like in this particular problem. Please guide me the proper method to approach the practice problems as i am having difficulty in solving them. Any help or any material i need to refer extra?
word_len =  for i in range(len(words)): word_len.append(str(words[i])) print(word_len)
What I expected to happen:
[6, 10, 5, 10, 7, 4, 11, 8, 11, 12, 4, 3, 4, 5, 5, 10, 7, 8, 6, 4]
What actually happened:
['tissue', 'psychology', 'blind', 'assessment', 'dynamic', 'hero', 'circulation', 'merchant', 'publication', 'interference', 'show', 'joy', 'sour', 'aloof', 'grass', 'distortion', 'exclude', 'pressure', 'bullet', 'calf']