4
문자열 배열이 아닌 객체 배열의 Python string.join (list)
파이썬에서는 다음과 같이 할 수 있습니다. >>> list = ['a', 'b', 'c'] >>> ', '.join(list) 'a, b, c' 객체 목록이있을 때 쉽게 할 수있는 방법이 있습니까? >>> class Obj: ... def __str__(self): ... return 'name' ... >>> list = [Obj(), Obj(), Obj()] >>> ', '.join(list) Traceback (most recent call last): …