Computer Science, asked by bansalchirag3202, 8 months ago

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 RewelDeepak
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 Anonymous
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