Skip to content

Commit 174a083

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 98fceea commit 174a083

File tree

13 files changed

+29
-30
lines changed

13 files changed

+29
-30
lines changed

digital_image_processing/filters/local_binary_pattern.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get_neighbors_pixel(
1919

2020
try:
2121
return int(image[x_coordinate][y_coordinate] >= center)
22-
except (IndexError, TypeError):
22+
except IndexError, TypeError:
2323
return 0
2424

2525

divide_and_conquer/convex_hull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _construct_points(
124124
else:
125125
try:
126126
points.append(Point(p[0], p[1]))
127-
except (IndexError, TypeError):
127+
except IndexError, TypeError:
128128
print(
129129
f"Ignoring deformed point {p}. All points"
130130
" must have at least 2 coordinates."

dynamic_programming/catalan_numbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def catalan_numbers(upper_limit: int) -> "list[int]":
7171
print(f"The Catalan numbers from 0 through {N} are:")
7272
print(catalan_numbers(N))
7373
print("Try another upper limit for the sequence: ", end="")
74-
except (NameError, ValueError):
74+
except NameError, ValueError:
7575
print("\n********* Invalid input, goodbye! ************\n")
7676

7777
import doctest

maths/greatest_common_divisor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def main():
6969
f"{greatest_common_divisor(num_1, num_2)}"
7070
)
7171
print(f"By iterative gcd({num_1}, {num_2}) = {gcd_by_iterative(num_1, num_2)}")
72-
except (IndexError, UnboundLocalError, ValueError):
72+
except IndexError, UnboundLocalError, ValueError:
7373
print("Wrong input")
7474

7575

project_euler/problem_002/sol4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def solution(n: int = 4000000) -> int:
5656

5757
try:
5858
n = int(n)
59-
except (TypeError, ValueError):
59+
except TypeError, ValueError:
6060
raise TypeError("Parameter n must be int or castable to int.")
6161
if n <= 0:
6262
raise ValueError("Parameter n must be greater than or equal to one.")

project_euler/problem_003/sol1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def solution(n: int = 600851475143) -> int:
8080

8181
try:
8282
n = int(n)
83-
except (TypeError, ValueError):
83+
except TypeError, ValueError:
8484
raise TypeError("Parameter n must be int or castable to int.")
8585
if n <= 0:
8686
raise ValueError("Parameter n must be greater than or equal to one.")

project_euler/problem_003/sol2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def solution(n: int = 600851475143) -> int:
4444

4545
try:
4646
n = int(n)
47-
except (TypeError, ValueError):
47+
except TypeError, ValueError:
4848
raise TypeError("Parameter n must be int or castable to int.")
4949
if n <= 0:
5050
raise ValueError("Parameter n must be greater than or equal to one.")

project_euler/problem_003/sol3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def solution(n: int = 600851475143) -> int:
4444

4545
try:
4646
n = int(n)
47-
except (TypeError, ValueError):
47+
except TypeError, ValueError:
4848
raise TypeError("Parameter n must be int or castable to int.")
4949
if n <= 0:
5050
raise ValueError("Parameter n must be greater than or equal to one.")

project_euler/problem_005/sol1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def solution(n: int = 20) -> int:
4747

4848
try:
4949
n = int(n)
50-
except (TypeError, ValueError):
50+
except TypeError, ValueError:
5151
raise TypeError("Parameter n must be int or castable to int.")
5252
if n <= 0:
5353
raise ValueError("Parameter n must be greater than or equal to one.")

project_euler/problem_007/sol2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def solution(nth: int = 10001) -> int:
8787

8888
try:
8989
nth = int(nth)
90-
except (TypeError, ValueError):
90+
except TypeError, ValueError:
9191
raise TypeError("Parameter nth must be int or castable to int.") from None
9292
if nth <= 0:
9393
raise ValueError("Parameter nth must be greater than or equal to one.")

0 commit comments

Comments
 (0)