# python program to check substring
# presents in the string or not
# string and substring declaration, initialization
str = "IncludeHelp.Com"
sub_str ="Help"
# checking sub_str presents in str or not
if sub_str in str:
print("Yes, substring presents in the string.")
else:
print("No, substring does not present in the string.");
# testing another substring
sub_str = "Hello"
# checking sub_str presents in str or not
if sub_str in str:
print("Yes, substring presents in the string.")
else:
print("No, substring does not present in the string.");
Output
Yes, substring presents in the string.
No, substring does not present in the string.
Program:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer