Typos in comments in hill_climbing.py (#1667)

* Typos in comments in hill_climbing.py

* fixup! Format Python code with psf/black push
This commit is contained in:
Christian Clauss
2020-01-08 14:06:53 +01:00
committed by John Law
parent 36d229f82a
commit 1f2b1a88ab
3 changed files with 41 additions and 35 deletions

View File

@@ -24,17 +24,18 @@ def bubble_sort(list1):
"""
for i, num in enumerate(list1):
try:
if list1[i+1] < num:
list1[i] = list1[i+1]
list1[i+1] = num
bubble_sort(list1)
except IndexError:
for i, num in enumerate(list1):
try:
if list1[i + 1] < num:
list1[i] = list1[i + 1]
list1[i + 1] = num
bubble_sort(list1)
except IndexError:
pass
return list1
return list1
if __name__ == "__main__":
list1 = [33,99,22,11,66]
bubble_sort(list1)
if __name__ == "__main__":
list1 = [33, 99, 22, 11, 66]
bubble_sort(list1)
print(list1)