I'm going to attach the entire list element as a string to distinguish each element
['a','b'] -> "a,b"
I'm going to add a comma like this.
Usually, I
''.join(map(lambda x: x+',',l))[:-1]
I wrote it like this, but I wonder if there is any other way.
android-listview python
Even if you don't use Lambda
myList = ['a','b','c','d']
myString = ",".join(myList)
You can write. If the list stores numbers, there will be an error, so please add a code that converts the type separately
myList = ','.join(map(str, myList))
© 2024 OneMinuteCode. All rights reserved.