We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e593839 commit 0aabbdaCopy full SHA for 0aabbda
__init__.py
@@ -2,16 +2,12 @@
2
3
app = Flask(__name__)
4
5
-@app.route('/<int:n>')
6
-def fibo(n):
7
- a, b = 0, 1
8
- res = str(a) # Initialisation avec le premier terme
9
-
10
- for _ in range(1, min(n, 50)): # Limité à 50 termes pour la sécurité
11
- res += f", {b}"
12
- a, b = b, a + b
13
14
- return res
+@app.route('/somme/<path:valeurs>')
+def somme(valeurs):
+ liste_nombres = valeurs.split('/')
+ liste_nombres = [int(n) for n in liste_nombres]
+ res = sum(liste_nombres)
+ return str(res)
15
16
if __name__ == '__main__':
17
app.run(host='0.0.0.0')
0 commit comments