- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
issuperset() in Python
In this article, we will learn about issuperset() in Python and its implementation in various areas.
This method returns boolean True if all elements of a set B contains all elements set A which is passed as an argument and returns false if all elements of A not present in B.
This means if B is a superset of A then it
returns true; else False
Example
Let’s look at some example
A = {'t','u','t','o','r','i','a','l'} B = {'t','u','t'} print("A issuperset B : ", A.issuperset(B)) print("B issuperset A : ", B.issuperset(A))
Output
A issuperset B : True B issuperset A : False
Example
A = {'t','u','t','o','r','i','a','l'} B = {'t','u','t'} C = {'o','r','i','a','l'} print("A issuperset B : ", A.issuperset(B)) print("B issuperset A : ", B.issuperset(A)) print("A issuperset C : ", A.issuperset(C)) print("B issuperset C : ", B.issuperset(C))
Output
A issuperset B : True B issuperset A : False A issuperset C : True B issuperset C : False
Conclusion
In this article, we learnt how to implement the issuperset() function in Python 3.x. Or earlier.
Advertisements