0 out of 464 challenges solved
Write a Python function `count_same_pair(nums1, nums2)` that takes two lists of the same length as input and returns the count of indices where the elements in both lists are equal. #### Example Usage ```python [main.nopy] count_same_pair([1, 2, 3, 4], [1, 2, 0, 4]) # Output: 3 count_same_pair([5, 6, 7], [5, 0, 7]) # Output: 2 count_same_pair([1, 2, 3], [4, 5, 6]) # Output: 0 ``` #### Constraints - The input lists will always have the same length. - The elements in the lists can be integers or floats.
def count_same_pair(nums1, nums2):
"""
Count the number of indices where the elements in two lists are the same.
Args:
nums1 (list): The first list of numbers.
nums2 (list): The second list of numbers.
Returns:
int: The count of indices where the elements in both lists are equal.
"""
# Initialize a counter for matching indices
count = 0
# Iterate through the lists and compare elements
# Placeholder for solution
return count