반응형
[파이썬 ( Python )] 자료구조 변경 (13)
# 자료구조의 변경
# 가고 싶은 여행지
Country = {"USA", "Janpan", "Egypt"}
print(Country, type(Country))
#Country의 타입은 현재 set입니다.
Country = list(Country)
print(Country,type(Country))
#List형태로 변환합니다.
Country = tuple(Country)
print(Country,type(Country))
#Tuple로 변환합니다.
Country = set(Country)
print(Country,type(Country))
#Set로 변환합니다.
반응형
'Python' 카테고리의 다른 글
[파이썬 ( Python )] 반복문 for (15) (0) | 2020.09.29 |
---|---|
[파이썬 ( Python )] 조건문 if (14) (0) | 2020.09.28 |
[파이썬 ( Python )] 집합 (Set) (12) (0) | 2020.09.22 |
[파이썬 ( Python )] Tuple - 튜플 (11) (0) | 2020.09.17 |
[파이썬 ( Python )] Dictionary - 딕셔너리 (10) (0) | 2020.09.16 |