20. Write a python function to count the number of same numbers with 3 given numbers in the list a and list b.
The output is:
list_a = [6, 6, 6]
list_b = [9, 7, 8]
Expected Answer:
The count of equal number is 3
The count of equal number is 0
Sample Answer:
def check_equal(a, b, c): result= set([a, b, c]) if len(result)==3: return 0 else: return (4 - len(result)) print("The count of equal number is", check_equal(6, 6, 6)) print("The count of equal number is", check_equal(9, 7, 8))
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)