Python 튜플 항목 제거
튜플 항목 제거
참고: 튜플에서 항목을 제거할 수 없습니다.
튜플은 변경할 수 없으므로 항목을 제거할 수 없지만 튜플을 완전히 삭제할 수 있습니다.
예시
del
키워드는 튜플을 완전히 삭제할 수 있습니다 .
thistuple = ("apple", "banana", "cherry")
del
thistuple
print(thistuple)
#this will raise an error because the tuple no longer exists