1>>> str = "Messi is the best soccer player"
2>>> "soccer" in str
3True
4>>> "football" in str
5False
1def find_string(string,sub_string):
2 return string.find(sub_string)
3#.find() also accounts for multiple occurence of the substring in the given string
1def is_value_in_string(value: str, the_string: str):
2 return value in the_string.lower()
1string = "My favourite programming language is Python"
2substring = "Python"
3
4if substring in string:
5 print("Python is my favorite language")
6elif substring not in string:
7 print("Python is not my favourite language")