from flask import Flask, request
app = Flask(__name__)
html_template = """
transformations
"""
@app.route("/", methods=["POST","GET"])
def transformations():
if request.method == "POST":
search = request.form["search"]
result_list = []
for character in search:
unicode_point = format(ord(character))
result_list.append(character + " " + unicode_point)
result_string = "
\n".join(result_list)
return html_template + f"{ result_string }
"
if request.method == "GET":
return html_template