Why the if statement being evaluated to True each time, even if I am deliberately giving biased inputs to my code . Here is my code:
s1 = 'efgh'
s2 = 'abcd'
for i in range(0, len(s1)):
for j in range(1, len(s1)+1):
if s1[i:j] in s2:
print('YES')
It print YES, 6 times. Why is that?