Skip to content

Commit 2df824d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 21ef5e1 commit 2df824d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

other/calc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
app = Flask(__name__)
44

5+
56
def calculate(num1: float, num2: float, operation: str) -> float:
67
"""
78
Perform basic arithmetic operations: add, subtract, multiply, divide.
@@ -32,6 +33,7 @@ def calculate(num1: float, num2: float, operation: str) -> float:
3233
else:
3334
raise ValueError(f"Unknown operation: {operation}")
3435

36+
3537
# HTML template for the web interface
3638
template = """
3739
<!DOCTYPE html>
@@ -68,6 +70,7 @@ def calculate(num1: float, num2: float, operation: str) -> float:
6870
</html>
6971
"""
7072

73+
7174
@app.route("/", methods=["GET", "POST"])
7275
def home():
7376
result = None
@@ -81,5 +84,6 @@ def home():
8184
result = str(e)
8285
return render_template_string(template, result=result)
8386

87+
8488
if __name__ == "__main__":
8589
app.run(debug=True)

0 commit comments

Comments
 (0)