Renamed folders to have leading 0.

This commit is contained in:
2017-12-16 12:54:29 +01:00
parent 00b91eae69
commit 70a2bf39ea
6 changed files with 0 additions and 0 deletions

27
luke_05/gullrekka.py Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
# @Author: KevinMidboe
# @Date: 2017-12-04 16:40:56
# @Last Modified by: KevinMidboe
# @Last Modified time: 2017-12-05 11:13:52
def gold():
gold_row = [1]
number = 1
while True:
countdown = gold_row[number-1]
while countdown > 0:
gold_row.append(number)
countdown -=1
if len(gold_row) >= 1000000:
return gold_row
number +=1
def main():
row = gold()
print('Finished with million iterations')
print(sum(row)+1)
if __name__ == '__main__':
main()