Skip to content

Commit 92c437d

Browse files
Add type hints to pancake_sort function
1 parent 456d644 commit 92c437d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sorts/pancake_sort.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
python pancake_sort.py
99
"""
1010

11+
from typing import List
1112

12-
def pancake_sort(arr):
13+
14+
def pancake_sort(arr: List[int]) -> List[int]:
1315
"""Sort Array with Pancake Sort.
1416
:param arr: Collection containing comparable items
1517
:return: Collection ordered in ascending order of items
@@ -36,4 +38,4 @@ def pancake_sort(arr):
3638
if __name__ == "__main__":
3739
user_input = input("Enter numbers separated by a comma:\n").strip()
3840
unsorted = [int(item) for item in user_input.split(",")]
39-
print(pancake_sort(unsorted))
41+
print(pancake_sort(unsorted))

0 commit comments

Comments
 (0)