Code

[python] set 자료형도 .join 함수가 가능하다.

비밀이얌뿌잉 2022. 2. 21. 16:25

 

"  ". join() 함수가 가능하다는 것!
str_data = { 'A', 'B', 'C'}
joined_str=" and ".join(str_data)
print(joined_str)
 

결과 값은 set 자료형 답게 

 

C and B and A

B and C and A

...

 

위와 같이 순서가 랜덤하게 등장한다!