Skip to content

Commit 8a8757c

Browse files
authored
Fix PIE808: Remove unnecessary start argument in range() for bubble_sort.py
Removed unnecessary range start in bubble sort loop.
1 parent d5e74ce commit 8a8757c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

logic_building_problems/bubble_sort.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def bubble_sort(arr: list[int | float]) -> list[int | float]:
4545
swapped = False
4646

4747
# Last i elements are already in place
48-
for j in range(0, n - i - 1):
48+
for j in range(n - i - 1):
4949
# Swap if the element found is greater than the next element
5050
if arr_copy[j] > arr_copy[j + 1]:
5151
arr_copy[j], arr_copy[j + 1] = arr_copy[j + 1], arr_copy[j]

0 commit comments

Comments
 (0)