The goal of this is to enter an amount and date for each account on a regular basis. The accounts are static (but more could be appended). What I am trying to do is loop through each account and for each account enter the amount and date. I am doing something wrong, I think in the increment line, and possibly the append line
After that I'd like to print the results to the screen in a way that makes sense (I know what I have is not correct and won't display in a sensible way)
Any ideas? Thanks
account = ['401k', 'RothIRA', 'HSA']
amount = []
date = []
while True:
print('Enter the amount for your ' + account[0] + ' account')
act = input()
amount.append(act)
print('Enter the date for this total')
dt = input()
date.append(dt)
account[] += 1
if act == '':
break
print(account, amount, date)
account[] += 1. When you doappendlist size is automatically incremented.classfor each account so that you don't need to be counting at the same time; that will give you more control over every account.