I'm trying to solve a problem that I'm facing. I wanted to convert a list of integers to a single integer(join all the elements of the list) and then split them to their original form. for example for the code below(assume I have a function that deals with the index of the y and the list) so if put in 'chart' for y
y = list(input("enter name"))
List=[1,2,3,4,5]
for i,p in enumerate(List):
y[i] = p
print('list is'y)
s = int(''.join([str(int) for int in List]))
print('joined form of the list is', s)
def dec():
t = [', '.join([str(int) for int in List])]
print('original form is', t)
dec()
I want the out put to be
List is [1, 2, 3, 4, 5]
joined form of the list is 12345
original form is [1, 2, 3, 4, 5]
instead for the original form I get a single string. How do I solve this?