I'm quite new to programming, and the solution is probably easy, but if anybody could explain whats going on, it would mean heaps :)
code:
def loan (loan_amount,number_of_weeks):
return (loan_amount/number_of_weeks)
loan_amount= int(input("Enter an amount: "))
number_of_weeks= int(input("Enter a number of weeks: "))
loan(loan_amount/number_of_weeks)
print ("you must repay",loan,"per week to repay a loan of",loan_amount,"in",number_of_weeks,"weeks")
error code:
Enter an amount: 5
Enter a number of weeks: 5
Traceback (most recent call last):
File "C:/Users/Ethan/PycharmProjects/untitled1/Loan.py", line 7, in <module>
loan(loan_amount/number_of_weeks)
TypeError: loan() missing 1 required positional argument: 'number_of_weeks'