Jun-12-2020, 04:01 PM
(Jun-11-2020, 04:09 AM)pav1983 Wrote:for x in range(len(a)): print a[x]
Quick point that may help understanding. Whenever you are using range(len(xxx)) there is always a better way. In this case
for element in a:gives you element, which is each item in the list. Get the len of element and append it to a second list that is your output. So, you need to define that second output list, change your loop, and return the output list.