@app.route('/', methods=['GET','POST'])
def params_form():
value = 2
value_dict = {'1': 1==value, '2': 2==value, '3': 3==value}
return render_template('home/sheet.html', value_dict=value_dict)
<div>
<input type="radio" id="n1" name="nyears" value=1 {{ 'checked' if value_dict["1"] else '' }} >
<label for="n1"> 1 </label>
<input type="radio" id="n2" name="nyears" value=2 {{ 'checked' if value_dict["2"] else '' }} >
<label for="n2"> 2 </label>
<input type="radio" id="n3" name="nyears" value=3 {{ 'checked' if value_dict["3"] else '' }} >
<label for="n3"> 3 </label>
</div>