Created
December 16, 2020 21:31
-
-
Save blackknight36/60c97af52a98a89815d3e95a8be5df1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
gifts = [ | |
{'name':'partridge', 'total':0}, | |
{'name':'turtle_doves', 'total':0}, | |
{'name':'french_hens', 'total':0}, | |
{'name':'calling_birds', 'total':0}, | |
{'name':'golden_rings', 'total':0}, | |
{'name':'geese', 'total':0}, | |
{'name':'swans', 'total':0}, | |
{'name':'maids', 'total':0}, | |
{'name':'ladies', 'total':0}, | |
{'name':'lords', 'total':0}, | |
{'name':'pipers', 'total':0}, | |
{'name':'drummers', 'total':0}, | |
] | |
for x in range(0, len(gifts)): | |
gifts[x]['total'] = (12-x)*(x+1) | |
print(f"{gifts[x]['name']}: {gifts[x]['total']}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment