Question: Write a Python function common data that takes two lists as arguments and returns True if they have at least one common element, otherwise
Write a Python function common data that takes two lists as arguments and returns "True" if they have at least one common element, otherwise "False". Hint: use nested loops. For example, if we have the two lists: list1= [1,2,3,4,5]; list2= [5,6,7,8,9] and we called the function (common data(list1, list2), then the returned value will be "True".
Step by Step Solution
3.50 Rating (150 Votes )
There are 3 Steps involved in it
The image contains instructions for writing a Python function named commondata that checks if two pr... View full answer
Get step-by-step solutions from verified subject matter experts
