Learn Before
Concept

issuperset(set)

x.issuperset(y) returns True if x is a superset of y, or, in other words, all items in set y are present in set x.

rainbow = {"red", "orange", "yellow", "green", "blue", "indigo", "violet"} colors = {"red", "orange"} cars = {"Toyota", "Honda", "Audi"} x = rainbow.issuperset(colors); // x = True y = rainbow.issuperset(cars); // y = False

x is set to True as all the elements in colors are contained in rainbow. y is set to False as rainbow does not contain all the elements of cars.

0

1

Updated 2021-05-31

Contributors are:

Who are from:

Tags

Python Programming Language

Data Science

Related