'not being able to pass a data from flask to html template

I'm using a very simple code to pass data from flask to html template but the value is not passed here is mi code

python code:

 @app.route("/",methods=['GET','POST']) 
 def home():
     if request.method=='GET':
         return render_template("base.html")
 
     if request.method=='POST':
         
 
         print('hello')
         resultat="helo"
         a=True
         return render_template("base.html",resultat=resultat)

html code:

<p> {%if a %} {{ resultat }} {% endif %} </p>

can someone help me please



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source