Python 튜플 항목이 있는지 확인
튜플 항목이 있는지 확인
지정된 항목이 튜플에 있는지 확인하려면 다음 in
키워드 를 사용하십시오.
예시
튜플에 "apple"이 있는지 확인하십시오.
thistuple = ("apple", "banana", "cherry")
if "apple" in thistuple:
print("Yes, 'apple' is in the fruits tuple")
지정된 항목이 튜플에 있는지 확인하려면 다음 in
키워드 를 사용하십시오.
튜플에 "apple"이 있는지 확인하십시오.
thistuple = ("apple", "banana", "cherry")
if "apple" in thistuple:
print("Yes, 'apple' is in the fruits tuple")