Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Shops/travel_guide_store/Homeworks/flask.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Сделайте так, чтобы при переходе на страницу
localhost:5000/hello/alex/age/100
На странице повлялся текст:
Hello Alex! Your age is 100!
А при переходе на
localhost:5000/hello/bob/age/1
Hello Bob! Your age is 1!"""

from flask import Flask


app = Flask(__name__)


@app.route("/hello/<string:name>/age/<int:age>")
def introduce(name: str, age: int):
return f"Hello {name.capitalize()}! Your age is {age}!"


app.run(port=5555)