Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,20 @@ def root():
|
|
9 |
@app.get("/replacement")
|
10 |
def get_code():
|
11 |
return {
|
12 |
-
"text": """def
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
|
|
|
9 |
@app.get("/replacement")
|
10 |
def get_code():
|
11 |
return {
|
12 |
+
"text": """def factorial(n):
|
13 |
+
if n == 0:
|
14 |
+
return 1
|
15 |
+
else:
|
16 |
+
result = 1
|
17 |
+
for i in range(1, n + 1):
|
18 |
+
result *= i
|
19 |
+
return result
|
20 |
|
21 |
+
def main():
|
22 |
+
nums = [3, 5, 7]
|
23 |
+
for num in nums:
|
24 |
+
print(f"Factorial of {num} is {factorial(num)}")
|
25 |
+
|
26 |
+
main()"""
|
27 |
}
|
28 |
+
|