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

0
764
string=input("Please enter string: ")
sub_string=input("Please enter substring: ")
if(string.find(sub_string)==-1):
print("Substring is not found in string")
else:
print("Substring is in string")

      Output 1:
             Please enter string: Python Programming
             Please enter substring: Python
             Substring is in string
      Output 2:
             Please enter string: Python Programming
             Please enter substring: Hello
             Substring is not found in string

इन्हें भी देखें।

Python Programs के लिये यहाँ click करें।

 

 

 

Python program to check if a substring is present in a given string program to check if a substring is present in a given string program to check if a substring is present in a given string in python write a python program to check if a substring is present in a given string check if a substring is present in a given string in python check if a substring is present in a given string python program to check if a substring is present in a given string program to string in substring in python

LEAVE A REPLY

Please enter your comment!
Please enter your name here