Python သည် Set တစ်ခုတွင် Item ရှိမရှိ စစ်ဆေးပါ။
Set တစ်ခုတွင် Item ရှိမရှိ စစ်ဆေးပါ။
သတ်မှတ်ထားသော အကြောင်းအရာတစ်ခုသည် သတ်မှတ်ချက်များတွင် ရှိနေခြင်းရှိမရှိ ဆုံးဖြတ်ရန် in
သော့ချက်စကားလုံးကို အသုံးပြုပါ-
ဥပမာ
set တွင် "apple" ရှိမရှိစစ်ဆေးပါ။
thisset = {"apple", "banana", "cherry"}
if "apple" in thisset:
print("Yes, 'apple' is in this set")