Learn Before
Concept

issubset(set)

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

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

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

0

1

Updated 2021-05-31

Contributors are:

Who are from:

Tags

Python Programming Language

Data Science

Related