+ 4
Method (Python3)
Someone remenber de method that does this? x = "123" x = x."method"(",") print(x) output=1,2,3 I forgot what is its name but i know that exist...
7 Respostas
+ 10
how about this: ",".join('123') syntax is different but working with lists too
+ 3
what is this I got error why you put method between " " .
+ 1
Maninder Singh i dont know the method, it is not part of the code, please read it again
+ 1
Mert Yazıcı No, the split method is different
+ 1
Markus Kaleton Not this module but it has the same result ,thank you so much
+ 1
Like Mert Yazıcı said, you can use x = ','.join(x) to put commas between the numbers in the string. Should work for any kind of iterable (strings, lists, tuples)