Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def substrinstr(str1, str2):
- T1 = ()
- L1 = list(str2)
- for i in str1:
- if any(L1):
- if (i.lower() == L1[0]):
- T1 += (i,)
- del L1[0]
- else:
- L1 = list(str2)
- if T1 == tuple(L1):
- return "The Sub-String is Present in the String..."
- else:
- return "The Sub-String is NOT Present in the String..."
- str1 = input("Enter the Full String : ")
- str2 = input("Enter the Sub-String to be searched for in the String : ")
- val = substrinstr(str1, str2)
- print(val)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement