Last active
March 11, 2016 18:22
-
-
Save technocake/da5e24e7f3bb8927e1a4 to your computer and use it in GitHub Desktop.
kompilert budsjett
This file contains hidden or 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 | |
#coding: utf-8 | |
inntekter = { | |
'kontigent': 50.00 * 10 | |
} | |
utgifter = { | |
'domeneavgift': 110, | |
'hostingutgifter': 0.0 | |
} | |
if __name__ == '__main__': | |
p=lambda d: "\n".join([str(i) for i in d.items()]) | |
print("Input") | |
print(p(inntekter)) | |
inn_sum = sum(inntekter.values()) | |
print("SUM: %.2f NOK\n"%inn_sum) | |
print("Output") | |
print(p(utgifter)) | |
ut_sum = sum(utgifter.values()) | |
print("SUM: %.2f NOK\n"%ut_sum) | |
print("Buffer: %.2f NOK"% (inn_sum-ut_sum)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Input
('kontigent', 500.0)
SUM: 500.00 NOK
Output
('hostingutgifter', 0.0)
('domeneavgift', 110)
SUM: 110.00 NOK
Buffer: 390.00 NOK
[Finished in 0.0s]