2022-2023/1NSI/05_Interaction_client-serveur/scripts/bottle_query.py

15 lines
288 B
Python
Raw Normal View History

from bottle import request, get
@get('/age')
def age_de():
name = request.query.name
age = request.query.age
if int(age) > 1:
return name + " a " + age + " ans."
elif int(age) <= 0:
return "Mouai..."
else:
return name + " a " + age + " an."