Python Set issuperset()メソッド
例
y
セットされたすべてのアイテムがセットに存在する場合はTrueを返します
x
。
x = {"f", "e", "d",
"c", "b", "a"}
y = {"a", "b", "c"}
z = x.issuperset(y)
print(z)
定義と使用法
指定されたセットのすべてのアイテムが元のセットに存在する場合、issuperset()
メソッドはTrueを返します。存在しない場合、Falseに戻ります。
構文
set.issuperset(set)
パラメータ値
Parameter | Description |
---|---|
set | Required. The set to search for equal items in |
その他の例
例
指定されたセットにすべてのアイテムが含まれていない場合はどうなりますか?
y
セット内のすべてのアイテムがセット内に存在しない場合はFalseを返します
x
。
x = {"f", "e", "d",
"c", "b"}
y = {"a", "b", "c"}
z = x.issuperset(y)
print(z)