Hi everyone, My question is related to lists in python 3.I have a list of strings which looks like this: :     list_of_string = [C1,D1,H14,J14,Y14.....AM20,AN20,DB33]
this list contain approx. 4000 elements (strings). Now I want to create another list which should look like this:

    new_list = [02C102D103H1403J1403Y14 upto  04AM2004AN2004DB33]
where 02 refers to the length of the first element C1. 02 the length of second element D1. so on and so forth till 04 which is the length of the last element DB33 etc etc.

I am struggling with the creation of new_list. Please help me with the same.

After this i want to convert new_list into bytearray which I will do like this:

    new_list_1 = new_list.encoding() # this will convert my new string to bytes
    new_list_bytearray = bytearray(new_list_1) # which will give me the desired byte array.

I am struggling with the creation of new_list.

Any help would be appriciated thanks!

# new to python. #new to programming.

 
 