Write a program to check if a substring is present in a given string


Topic: Write a program to check if a substring is present in a given string

Solution

string = "how are you?"
substring = "are"
if (string.find(substring) == -1): 
    print("NO") 
else: 
    print("YES")  



List all Python Programs