Skip to content

Commit f605cfa

Browse files
Update pigeonhole_sort.py
1 parent 7456a84 commit f605cfa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sorts/pigeonhole_sort.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ def pigeonhole_sort(a):
1212
True
1313
1414
>>> pigeonhole_sort([])
15-
None
1615
"""
17-
# if not a:
18-
# return # this handles empty list
16+
if not a:
17+
return
1918
# size of range of values in the list (ie, number of pigeonholes we need)
2019

2120
min_val = min(a) # min() finds the minimum value
@@ -43,7 +42,7 @@ def pigeonhole_sort(a):
4342
def main():
4443
a = [8, 3, 2, 7, 4, 6, 8]
4544
pigeonhole_sort(a)
46-
print("Sorted order is:", " ".join(map(str, a))) # it converts integer into string
45+
print("Sorted order is:", *a)
4746

4847

4948
if __name__ == "__main__":

0 commit comments

Comments
 (0)