From 92b5e2f517671da32b54e87a1eb6345d54719bad Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 20 Nov 2023 14:39:24 +0100 Subject: [PATCH] vault backup: 2023-11-20 14:39:24 --- Algo/B2/Exercises/Repetitive tutorial.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Algo/B2/Exercises/Repetitive tutorial.md b/Algo/B2/Exercises/Repetitive tutorial.md index c0e3037..9726c07 100644 --- a/Algo/B2/Exercises/Repetitive tutorial.md +++ b/Algo/B2/Exercises/Repetitive tutorial.md @@ -48,5 +48,9 @@ def productZ(x, y): ## Exercise 1.3 ``` -def exponentiation(x: int, n: int) -> int: - \ No newline at end of file +def exponetial(x: int, n: int) -> int: + result = 0 + while n > 0: + m *= x + n -= 1 + return result \ No newline at end of file