I would like to know how to write a function that returns True
if the first string, regardless of position, can be found within the second string by using two strings taken from user input. Also by writing the code, it should not be case sensitive; by using islower()
or isupper()
.
Example Outputs:
1st String: lol
2nd String: Hilol
True
1st String: IDK
2nd String: whatidk
True
My code:
a1 = str(input("first string: "))
a2 = str(input("second string: "))
if a2 in a1:
print(True)
else:
print(False)
It outputs:
1st String: lol
2nd String: lol
True
1st String: lol
2nd String: HIlol
False #This should be true, IDK why it is false.
I only came this far with my code. Hoping someone could teach me what to do.