Write a Python function called dotproduct that takes two iterables of numeric values ( vec1 and vec2 ) and…
Write a Python function called dotproduct that takes two iterables of numeric values ( vec1 and vec2 ) and…: a task in repo2rlenv-r2e (Harbor dataset). Requirements: - The function must accept any iterable type as input, including lists, tuples, and generators/iterators. - Both iterables must have…
The task
Requirements: - The function must accept any iterable type as input, including lists, tuples, and generators/iterators. - Both iterables must have the same length and contain numeric values (int or float). - The return type should be numeric: an int when all products are integers, a float when any element is a float.…
Part of FineEnvs/repo2rlenv-r2e.