mirror of
https://github.com/KevinMidboe/knowit_julekalender-2018.git
synced 2025-10-29 09:40:18 +00:00
On the sixed day of christmas my true love gave to me Nulltunge™️
This commit is contained in:
14
luke_06/nulltunge.py
Executable file
14
luke_06/nulltunge.py
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
def main():
|
||||||
|
total = 0
|
||||||
|
for i in range(18163106):
|
||||||
|
zeros = str(i).count('0')
|
||||||
|
if zeros > len(str(i)) - zeros:
|
||||||
|
total += i
|
||||||
|
|
||||||
|
return total
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
res = main()
|
||||||
|
print(res)
|
||||||
@@ -1,2 +1,4 @@
|
|||||||
|
from luke_06.nulltunge import main as nulltunge
|
||||||
|
|
||||||
def test_answer():
|
def test_answer():
|
||||||
assert False
|
assert nulltunge() == 78650247070
|
||||||
|
|||||||
Reference in New Issue
Block a user