Home >Backend Development >Python Tutorial >Python method to determine whether a set is a subset of another set

Python method to determine whether a set is a subset of another set

不言
不言Original
2018-05-05 10:17:176269browse

This article mainly introduces the method of python to determine whether a set is a subset of another set. It has a certain reference value. Now I share it with you. Friends in need can refer to it

The example is as follows:

a = [1,2,3,4]
b = set([1,2])
b.issubset(a)

Related recommendations:

Introduction How to determine whether a number is a positive decimal or integer using python

The above is the detailed content of Python method to determine whether a set is a subset of another set. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn