Skip to content

Instantly share code, notes, and snippets.

@technocake
Last active March 11, 2016 18:22
Show Gist options
  • Save technocake/da5e24e7f3bb8927e1a4 to your computer and use it in GitHub Desktop.
Save technocake/da5e24e7f3bb8927e1a4 to your computer and use it in GitHub Desktop.
kompilert budsjett
#!/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))
@technocake
Copy link
Author

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment