Skip to content

Instantly share code, notes, and snippets.

@ofelix03
Last active April 11, 2021 00:32
Show Gist options
  • Select an option

  • Save ofelix03/2e82518836b0e1c67efee2a530af92f9 to your computer and use it in GitHub Desktop.

Select an option

Save ofelix03/2e82518836b0e1c67efee2a530af92f9 to your computer and use it in GitHub Desktop.
summation-using-for-loop-bad
allocation_amounts = [120.0, 320.30, 420.0, 100.0]
total_allocation = 0
for amount in allocation_amounts:
total_allocation = total_allocation + amount
print("total_allocation: ", total_allocation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment