mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-17 15:54:07 +10:00
Dang
This commit is contained in:
16
scripts/test_sum/test_sum.py
Normal file
16
scripts/test_sum/test_sum.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import sys
|
||||
sys.setrecursionlimit(11000)
|
||||
|
||||
#the test case (python)
|
||||
def test_sum(key: int, val: int):
|
||||
def sum(n: int):
|
||||
if n < 2:
|
||||
return n
|
||||
|
||||
return n + sum(n - 1)
|
||||
|
||||
result: int = sum(val)
|
||||
print(str(key) + ": " + str(result))
|
||||
|
||||
for i in range(0, 10):
|
||||
test_sum(i, i * 1000)
|
||||
Reference in New Issue
Block a user