Define a function overlapping ( ) that takes two lists and returns True if they have at least one member in common, False otherwise.
Answers
Answered by
0
Answer:
· Python List: Exercise-11 with Solution. Write a Python function that takes two lists and returns True if they have at least one common member
Answered by
2
A function overlapping ( ) that takes two lists and returns either True if they have at least one member in common or False is given below:
def overlapping ( x _1 , y_2 ) :
Res = False
for a in x_1 :
for b in y_2 :
if a = = b :
Res = True
return Res
print ( overlapping ( [ 11 , 12 , 13 , 14 , 15 ] , [ 15 , 16 , 17 , 18 , 19 ] ) )
print ( overlapping ( [ 11 , 12 , 13 , 14 , 15 ] , [ 16 , 17 , 18 , 19 ] ) )
Similar questions
Hindi,
5 months ago
Biology,
5 months ago
English,
5 months ago
Computer Science,
11 months ago
English,
1 year ago