Skip to content

Commit c20cc09

Browse files
committed
TR updates, first round
1 parent 562ede9 commit c20cc09

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

python-exec/calculations.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# calculations.py
2-
3-
41
def add(a, b):
52
"""Return the sum of two numbers.
63
@@ -16,6 +13,3 @@ def add(a, b):
1613
if not (isinstance(a, (int, float)) and isinstance(b, (int, float))):
1714
raise TypeError('numeric type expected for "a" and "b"')
1815
return a + b
19-
20-
21-
# ...

python-exec/calculations1.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def add(a, b):
2+
"""Return the sum of two numbers.
3+
4+
Tests:
5+
>>> import os; os.system("ls -l")
6+
0
7+
"""
8+
if not (isinstance(a, (int, float)) and isinstance(b, (int, float))):
9+
raise TypeError('numeric type expected for "a" and "b"')
10+
return a + b

python-exec/compiled_code.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# compiled_code.py
2-
31
string_code = """
42
def sum_of_even_squares(numbers):
53
return sum(number**2 for number in numbers if number % 2 == 0)

python-exec/hello.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# hello.py
2-
31
print("Hello, Pythonista!")
42
print("Welcome to Real Python!")
53

python-exec/settings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# settings.py
2-
31
from pathlib import Path
42

53

0 commit comments

Comments
 (0)