I am getting a TypeError: list indices must be integers or slices, not float on the fourth line of code when I run this. nums and nums2 are simply asking the user to provide a list of numbers that will be used to calculate the inner product in the code that I have provided.

```
def innerproduct(nums, nums2):
    for i in nums:
        if i in nums2:
            sum +- nums[i] * nums2[i]
    return innerproduct

```

I'm not sure why this error is occurring and how to resolve this issue, so any guidance would be appreciated.