I have a little problem with my code, it receives "institutions" (names that the user wants in the input) within a dictionary, this input is passing the dictionary as a list, and then I use the list to make a "donation "until then it is quiet the problem happens when it is in a loop of repetition doing this process more than once in the part of the" institution "works normally without overwriting the previous one however when and in the donation the last value added and subsisted by the current ex: was donated 1000 and in the second donation was donated plus 200 should save the value 1200, but the value 1000 some and only the last value is 200, here is the code, if they can help you as soon as possible.
instituicoes = []
def doação():
while True:
instituicao_add = input("0 para deixar de adicionar\ndigite alguma instituicao\n:") #ex: 'stack overflow pt'
if(instituicao_add == '0'):
break
instituicoes.append({'nome': instituicao_add})
while True:
for i, xc in enumerate(instituicoes):
print(i,"-",xc)
x = int(input("\nQual instituição deseja escolher?")) # ex: 0
while x >= len(instituicoes) or x < 0: # Verificar se index existe na nossa lista de instituicoes
x = int(input("\nQual instituição deseja escolher?")) # ex: 0
dinheiro = int(input("\nQuanto deseja doar?\n"))
instituicoes[x]['doação'] = dinheiro # ex: 1000
print("Obrigado por ajudar esta instituição")
print(instituicoes[x]) # output: {'nome':'stack overflow pt', 'doação': 1000}
#para imprimir só o valor doado
print(instituicoes[x]['doação'])
doação()