navpan2 commited on
Commit
0518cf5
·
verified ·
1 Parent(s): 3f04dfe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -9,8 +9,20 @@ def root():
9
  @app.get("/replacement")
10
  def get_code():
11
  return {
12
- "text": """def greet(name):
13
- print(f"Hello, {name}!")
 
 
 
 
 
 
14
 
15
- greet("World")"""
 
 
 
 
 
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
+