You could use any
here.
>>> string = r"/\?%"
>>> test = "This is my string % my string ?"
>>> any(elem in test for elem in string)
True
>>> test2 = "Just a test string"
>>> any(elem in test2 for elem in string)
False
More Related Contents:
- __init__() missing 1 required positional argument ‘address’
- How do I check what version of Python is running my script?
- multiprocessing: How do I share a dict among multiple processes?
- What does the percentage sign mean in Python
- Python modulo on floats
- Does Python support MySQL prepared statements?
- Does spark predicate pushdown work with JDBC?
- Is there a description of how __cmp__ works for dict objects in Python 2?
- Overriding “+=” in Python? (__iadd__() method)
- Accessing CPU temperature in python
- Split views.py in several files
- python typing module: Mixin
- Numpy Resize/Rescale Image
- Find the unique values in a column and then sort them
- “RuntimeError: generator raised StopIteration” every time I try to run app
- xarray select nearest lat/lon with multi-dimension coordinates
- How do I run graphx with Python / pyspark?
- How is pandas groupby method actually working?
- Why does reversing a list using slice notation with 0 as “stop” not return the entire list?
- How to hide axes and gridlines in Matplotlib (python) [duplicate]
- Python Pandas merge only certain columns
- How to make a 3D scatter plot in matplotlib
- How to delete all the entries from google datastore?
- How to open external programs in Python
- Call exiftool from a python script?
- Python 3.4: How to import a module given the full path? [duplicate]
- Convert decimal to ternary(base3) in python
- When should I use root.update() in tkInter for python
- bash: Python import – Command not found for pandas
- Length of longest word in a list