def list_L(A,B):
d=[]
for i in range(A):
C=B.count(A[i])
d.append(C)
k=d.count(0)
return True
else:
return False
A=[int(x) for x in input("enter list1 elements:").split()]
B=[int(x) for x in input("enter list2 elements:").split()]
if True:
print ("overlapping")
else:
print ("non-overlapping")
Even if it's an element that doesn't overlap, it keeps overlapping.
list function
fori in range(A):
not this, but fori in range(len(A):
is intended, right?
Other than that, the code doesn't make sense.
if True:
This only fits in the if
condition, and it can never go with else
.
You should study the basics.
If you're having a hard time, you're not good at programming, so do something else.
© 2024 OneMinuteCode. All rights reserved.