Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- number = 0
- y = 0
- sortlist = [10, 12, 14, 16, 18, 20, 22, 24, 40]
- sortlist2 = []
- def inputnmbrs():
- print("input")
- def select(values):
- #("Okay, let's select sort! Please enter numbers, one by one. When you have finished inputting numbers, please enter [X]")
- print("Do you want it to sort in ascending or descending order...or do you want to input?[ascend][descend][input]")
- selectchoice = input()
- if selectchoice == "descend":
- values.remove(max(values))
- sortlist2.append(max(values))
- for i in range(y, len(values) - 1):
- values.remove(max(values))
- sortlist2.append(max(values))
- print(sortlist2)
- print(sortlist2)
- elif selectchoice == "ascend":
- for i in range(y, len(values) - 1):
- values.remove(min(values))
- sortlist2.append(min(values))
- print(sortlist2)
- elif selectchoice == "input":
- def inputselect(Inputnumbers):
- print("input your numbers")
- Inputnumbers = input("input numbers separated by a comma: ")
- separatedselect = Inputnumbers.split(" , ")
- for i in range(y, len(separatedselect)):
- separatedselect.remove(min(separatedselect))
- sortlist2.append(min(separatedselect))
- print(sortlist2)
- def integrate():
- print("integrate")
- def bubble():
- print("bubble")
- print("Hey, welcome to my sorting algorithm!")
- print("What sort would you like me to do? [select], [integrate], [bubble], or would you like to input your own numbers [numbers]?")
- sortchoice = input()
- if sortchoice.lower() == "select":
- select(sortlist)
- elif sortchoice.lower() == "integrate":
- integrate()
- elif sortchoice.lower() == "bubble":
- bubble()
- elif sortchoice.lower() == "numbers":
- inputnmbrs()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement