0

this is what I wish for...

INPUT [1,2,3,4,5]

OUTPUT 12345

I've tried this but it didn't work...

l1 = [1,2,3,4,5,6]
print([int(n1) for n1 in str(l1).split() if n1.isdigit()])

1 Answers1

1

If you want the result to be an integer, the following should do the trick:

int(''.join([str(i) for i in l1]))

If you still want it as a string then simply do

''.join([str(i) for i in l1])
Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156