Jun-06-2019, 10:05 PM
So, this is interesting...
It prints Pam 205.36 2 times
what happened to Bruce 37.95?
It prints Pam 205.36 2 times
what happened to Bruce 37.95?
class check: payee = '' amount = 0.0 c = check #create a check object checkbook = [c] #checkbook is a list of checks c.payee = 'Bruce' c.amount = 37.95 checkbook.append(c) #add check to checkbook c.payee = 'Pam' c.amount = 205.36 checkbook.append(c) #add check to checkbook #print them for each_check in range(1,len(checkbook)): print(check.payee,check.amount)