Пытался написать программу для вычисления скалярного произведения двух векторов. Загуглил как искать, и написал вот такой код. Выдаёт указанную в названии ошибку. Много раз пытался что-то изменить, но ничего не помогает. Версия питона 3.8.5
Python:
vectorOne = str(input('enter the coordinates of the first vektor: '))
vectorTwo = str(input('enter the coordinates of the second vektor: '))
while len(vectorOne.split()) != len(vectorTwo.split()):
print()
print('vectors mast have the same number of parameters!')
vectorOne = str(input('enter the coordinates of the first vektor: '))
vectorTwo = str(input('enter the coordinates of the second vektor: '))
amountParameter = int(len(vectorOne))
def scalar(vectorOne,vectorTwo,amountParameter):
amountParameter -=1
if amountParameter == -1:
return 0
else:
return int(vectorOne.split()[amountParameter])*int(vectorTwo.split()[amountParameter])+scalar(vectorOne,vectorTwo,int(amountParameter))
print(scalar(vectorOne,vectorTwo,int(amountParameter)))
input()