mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 08:47:01 +00:00
commit
335bc2e390
|
@ -44,7 +44,13 @@ def cycle_sort(array):
|
||||||
|
|
||||||
|
|
||||||
# Main Code starts here
|
# Main Code starts here
|
||||||
user_input = input('Enter numbers separated by a comma:\n')
|
if __name__ == '__main__':
|
||||||
|
try:
|
||||||
|
raw_input # Python 2
|
||||||
|
except NameError:
|
||||||
|
raw_input = input # Python 3
|
||||||
|
|
||||||
|
user_input = raw_input('Enter numbers separated by a comma:\n')
|
||||||
unsorted = [int(item) for item in user_input.split(',')]
|
unsorted = [int(item) for item in user_input.split(',')]
|
||||||
n = len(unsorted)
|
n = len(unsorted)
|
||||||
cycle_sort(unsorted)
|
cycle_sort(unsorted)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user