Try using in
like this:
>>> x = 'hello'
>>> y = 'll'
>>> y in x
True
More Related Contents:
- find all possible combinations of letters in a string in python [duplicate]
- Does Python have a string ‘contains’ substring method?
- How do I get a substring of a string in Python?
- Why does substring slicing with index out of range work?
- How to extract the substring between two markers?
- How to get a string after a specific substring?
- Find the nth occurrence of substring in a string
- How To Get All The Contiguous Substrings Of A String In Python?
- Replace nth occurrence of substring in string
- Find substring in string but only if whole words?
- Python: How to check a string for substrings from a list? [duplicate]
- Python: Find a substring in a string and returning the index of the substring
- Why is it string.join(list) instead of list.join(string)?
- How to find all occurrences of a substring?
- Comparing a string to multiple items in Python
- Join a list of items with different types as string in Python
- How to convert string to binary?
- ‘str’ object does not support item assignment
- Split a string at uppercase letters
- python replace single backslash with double backslash
- Python float – str – float weirdness
- formatting long numbers as strings in python
- How to create a numpy array of arbitrary length strings?
- How to write very long string that conforms with PEP8 and prevent E501
- Remove ‘b’ character do in front of a string literal in Python 3 [duplicate]
- Python regex: splitting on pattern match that is an empty string
- How to decode a video (memory file / byte string) and step through it frame by frame in python?
- Byte Array to Hex String
- String-based enum in Python
- Ignore case in Python strings [duplicate]