Python Kümesi isdisjoint() Yöntemi
Örnek
sette hiçbir öğe yoksa sette True
x
döndürün y
:
x = {"apple", "banana", "cherry"}
y = {"google", "microsoft", "facebook"}
z = x.isdisjoint(y)
print(z)
Tanım ve Kullanım
Her isdisjoint()
iki kümede de öğelerin hiçbiri yoksa yöntem True, aksi takdirde False döndürür.
Sözdizimi
set.isdisjoint(set)
Parametre Değerleri
Parameter | Description |
---|---|
set | Required. The set to search for equal items in |
Daha fazla örnek
Örnek
Her iki sette de hiçbir öğe yoksa ne olur?
Her iki kümede de bir veya daha fazla öğe varsa False döndürün:
x =
{"apple", "banana", "cherry"}
y = {"google",
"microsoft", "apple"}
z = x.isdisjoint(y)
print(z)