Answers for "Write a Python program to accept two strings as input and check if they are identical copy of each other or if the second string is a substring of the first string."

0

Write a Python program to accept two strings as input and check if they are identical copy of each other or if the second string is a substring of the first string.

ss='Hello w'
ms='Hello world'

if(ss==ms):
    print( 'Both the strings are same')

elif(ms.find(ss)!=-1):
    print ('{0} is a substring of {1}'.format(ss,ms))

else:
    print ('None')
Posted by: Guest on June-19-2020

Code answers related to "Write a Python program to accept two strings as input and check if they are identical copy of each other or if the second string is a substring of the first string."

Python Answers by Framework

Browse Popular Code Answers by Language