What is issubset method in sets | How to use issubset method of sets.

Definition

This method returns true if one sets items are present inside another set, that is it returns true if one set is subset for another set. Since it returns a value original set remains unchanged and value is printed through third variable.

Syntax

Variable = A.issubset(B)

This method takes an argument

Working

Code

  1. Set A being taken
  2. Set B is being taken
  3. issubset() method is being applied to set B with the help of set A.
  4. Value is being printed inside C.

Output

  1. Returns true since B set is present inside set A

Note that if there is a mismatch of even a single item it will return a false.

Quick Links:

What is a list in python, How to use list and its methods?

What Are List/Array Methods | Types Of Methods In Python List.

Waqar Khan

Hello, everyone, I am Waqar Khan. I have done my B.tech in Computer Science. I love to write about Computer Informational blogs. Before write I did proper research on it. Hope you like our blogs. Thank you.

Related Posts

Leave a Reply

Your email address will not be published.