detect character in string python code example
Example 1: detect character in string python
fullstring = "StackAbuse"
substring = "tack"
if substring in fullstring:
print "Found!"
else:
print "Not found!"
Example 2: find character in python
banana = "banana"
banana.find("a")
#1
banana.find("a",2)
#3