Python Kontroleer of item in 'n stel bestaan
Kyk of item in 'n stel bestaan
Om te bepaal of 'n gespesifiseerde item in 'n stel teenwoordig is, gebruik die in
sleutelwoord:
Voorbeeld
Kyk of "appel" teenwoordig is in die stel:
thisset = {"apple", "banana", "cherry"}
if "apple" in thisset:
print("Yes, 'apple' is in this set")