I have looked at other questions but I dont believe these apply to my situation - as I cannot defer what I need to do from them.
To sum up the bit of code with issue:
import numpy as np
noInvestments=int(input("How many types of savings will you have? "))
savingTypes=[np.empty(())]
interests=np.empty(())
years=np.empty(())
contributions=np.empty(())
balance=np.empty(())
for i in range(0,noInvestments):
totalContributions=0
totalYears=0
p=float(input("What is your principal? "))
name=str(input("What is the savings type name? "))
#save savings type into array
savingTypes[i]=name
interest=float(input("What is the interest? (%) "))
#save interest into array
interests[i]=interest
z=1+(interest/100)
I want to be able to pull the array, after the loop is done, and have corresponding names of the accounts and the interest rates. I have been trying different things, and last time I ran it, the savingTypes[i]=name worked perfectly, and the interest one came with the error again? I cannot see anything different apart from how they are stored and this hasn't changed it before?
Hopefully someone is able to help! I would be very grateful!