400 Bad Request: The browser (or proxy) sent a request that this server could not understand. KeyError: ‘a'”

Solution
@app.route('/', methods=['POST', 'GET'])
def index():
    Sum = ' '
    if len(request.form['a']) > 2:
        flash('completed!')
    else:
        flash('AAAAHHH')
    if request.method == 'POST':
        a = request.form['a']
        b = request.form['b']
        newSum = float(a)+float(b)
        Sum = str(newSum)   
    else:
        Sum = 'err'
    return render_template('index.html', Sum=Sum)