Solution
@app.route('/', methods=['GET', 'POST'])
def index():
x = 4
if request.method == 'POST':
data = request.form.getlist('a', type=str)
rslt = ' '.join(data)
return render_template('index.html', **locals())
{% if rslt %}
{% endif %}
from itertools import combinations
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
data = request.form.getlist('a', type=str)
rslt = ' '.join(data)
x = 4
pairs = combinations(range(1,x), 2)
return render_template('index.html', **locals())
{% if rslt %}
{% endif %}