Python Kontroleer of Tuple-item bestaan
Kyk of Tuple-item bestaan
Om te bepaal of 'n gespesifiseerde item in 'n tupel teenwoordig is, gebruik die in
sleutelwoord:
Voorbeeld
Kyk of "appel" teenwoordig is in die tupel:
thistuple = ("apple", "banana", "cherry")
if "apple" in thistuple:
print("Yes, 'apple' is in the fruits tuple")