If all items are unique, you can use sets.
>>> items = set([-1, 0, 1, 2])
>>> set([1, 2]).issubset(items)
True
>>> set([1, 3]).issubset(items)
False
More Related Contents:
- Encrypting and decrypting a password raises ValueError
- Redirect the output of python script into a text file [duplicate]
- Get the row(s) which have the max value in groups using groupby
- Python int to binary string?
- How to extract the substring between two markers?
- Is there a portable way to get the current username in Python?
- How does zip(*[iter(s)]*n) work in Python?
- mkdir -p functionality in Python [duplicate]
- Changing an element in one list changes multiple lists [duplicate]
- Error “ImportError: DLL load failed: %1 is not a valid Win32 application”
- Saving the state of a program to allow it to be resumed [duplicate]
- Properties file in python (similar to Java Properties)
- How do I create a date picker in tkinter?
- Chromedriver only supports characters in the BMP error while sending Emoji with ChromeDriver Chrome using Selenium Python to Tkinter’s label() textbox
- Can an asyncio event loop run in the background without suspending the Python interpreter?
- Django gives Bad Request (400) when DEBUG = False
- Why does the Python 2.7 AMD 64 installer seem to run Python in 32 bit mode?
- drop trailing zeros from decimal
- How to set target hosts in Fabric file
- How to install SciPy on Apple Silicon (ARM / M1)
- Eclipse and Google App Engine: ImportError: No module named _sysconfigdata_nd; unrecognized arguments: –high_replication
- Python 2: SMTPServerDisconnected: Connection unexpectedly closed
- How do “and” and “or” work when combined in one statement? [duplicate]
- Python: Best Way to remove duplicate character from string
- Using Python to execute a command on every file in a folder
- Airflow “This DAG isnt available in the webserver DagBag object “
- Overwrite previous output in jupyter notebook
- pdfminer – ImportError: No module named pdfminer.pdfdocument
- calculate distance of 2 list of points in numpy
- functools.partial wants to use a positional argument as a keyword argument