Skip to content

Instantly share code, notes, and snippets.

@sid86-dev
Created September 5, 2021 16:46
Show Gist options
  • Save sid86-dev/d09c79ebef22a7f90b66f392b6f3f303 to your computer and use it in GitHub Desktop.
Save sid86-dev/d09c79ebef22a7f90b66f392b6f3f303 to your computer and use it in GitHub Desktop.
Concept Calculator Flask
if request.method == "POST":
option = request.form.get('option')
num1 = request.form.get('num1')
num2 = request.form.get('num2')
if option == "Addition":
data = num1 + num2
elif option == "subtraction":
datd = num1 - num2
elif option == "subtraction":
datd = num1 / num2
elif option == "subtraction":
data = num1 * num2
return render_template('result.html', data=data)
return render_template('index2.html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment