Comment imprimer uniquement l'itération finale d'un pour Loop Pyhton
prices = [10, 20, 30]
total = 0
for price in prices:
total += price
#print(f'total: {total}') will give all iterations in order
print(f'total: {total}') #make sure to print outside of loop for
#only final iteration to print
Naughty Narwhal