Why does the length of the elements in the list shrink? [closed]

Solution 1:

As well as what other people have answered, print the list so you can see what Python sees in the list:

>>> print(num)
['a', 'b', 'c', 'd', 'ef']

then you can see where the problem is.

Solution 2:

num = ['a',
       'b',
       'c',
       'd',
       'e'  //Here should have a comma.
       'f']
num_len = len(num)
print(num_len)