[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-11-20 12:30:51 +00:00
parent 851c740d21
commit 1f470e7932
3 changed files with 8 additions and 10 deletions

View File

@ -22,8 +22,7 @@ def distance(a: Point, b: Point) -> float:
is {distance(point1, point2)}")
Distance from Point(2, -1, 7) to Point(1, -3, 5) is 3.0
"""
return math.sqrt(abs((b.x - a.x) ** 2 + (b.y - a.y) ** 2
+ (b.z - a.z) ** 2))
return math.sqrt(abs((b.x - a.x) ** 2 + (b.y - a.y) ** 2 + (b.z - a.z) ** 2))
if __name__ == "__main__":

View File

@ -35,8 +35,7 @@ def quick_sort(collection: list) -> list:
lesser_partition, greater_partition = partition(collection, pivot)
return [*quick_sort(lesser_partition), pivot,
*quick_sort(greater_partition)]
return [*quick_sort(lesser_partition), pivot, *quick_sort(greater_partition)]
def partition(collection: list, pivot) -> tuple[list, list]: