File size: 882 Bytes
abd659f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<!DOCTYPE html>
<html>
<head>
<title>Simple Calculator</title>
</head>
<body>
<h1>Simple Calculator</h1>
<form method="POST" action="/calculate">
<label for="num1">Number 1:</label>
<input type="text" id="num1" name="num1" required><br><br>
<label for="num2">Number 2:</label>
<input type="text" id="num2" name="num2" required><br><br>
<label for="operation">Operation:</label>
<select id="operation" name="operation">
<option value="add">Add</option>
<option value="subtract">Subtract</option>
<option value="multiply">Multiply</option>
<option value="divide">Divide</option>
</select><br><br>
<button type="submit">Calculate</button>
</form>
{% if result is not none %}
<h2>Result: {{ result }}</h2>
{% endif %}
</body>
</html>
|