We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 125441a commit bcb9fbdCopy full SHA for bcb9fbd
2 files changed
python-code-quality/functionality.py
@@ -2,7 +2,7 @@
2
# return a + b
3
4
5
-def add_numbers(a: int | float, b: int | float) -> int | float:
+def add_numbers(a: int | float, b: int | float) -> float:
6
a, b = float(a), float(b)
7
return a + b
8
python-code-quality/testability.py
@@ -1,19 +1,19 @@
1
# import pytest
# def greet(name):
-# print(f"Hello, {name}")
+# print(f"Hello, {name}!")
# def test_greet(capsys):
# greet("Alice")
9
# captured = capsys.readouterr()
10
-# assert captured.out.strip() == "Hello, Alice"
+# assert captured.out.strip() == "Hello, Alice!"
11
12
13
def greet(name: str) -> str:
14
- return f"Hello, {name}"
+ return f"Hello, {name}!"
15
16
17
# Easy to test
18
def test_greet():
19
- assert greet("Alice") == "Hello, Alice"
+ assert greet("Alice") == "Hello, Alice!"
0 commit comments