Skip to content

Commit c8ea89a

Browse files
Add this to the inside main condition
1 parent f89f005 commit c8ea89a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sorts/pancake_sort.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ def pancake_sort(arr):
1313
cur -= 1
1414
return arr
1515

16-
print(pancake_sort([0,10,15,3,2,9,14,13]))
16+
if __name__ == '__main__':
17+
print(pancake_sort([0,10,15,3,2,9,14,13]))

sorts/topological_sort.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ def topological_sort(start, visited, sort):
2828
# return sort
2929
return sort
3030

31-
32-
sort = topological_sort('a', [], [])
33-
print(sort)
31+
if __name__ == '__main__':
32+
sort = topological_sort('a', [], [])
33+
print(sort)

0 commit comments

Comments
 (0)