It's my first time in coding in Python, I have created a code that bubbles sort a given list. This is my code:
def bubbleSort(alist):
for passnum in range(len(alist)-1,0,-1):
for i in range(passnum):
if alist[i]>alist[i+1]:
temp = alist[i]
alist[i] = alist[i+1]
alist[i+1] = temp
alist = ["hi",50,93,"/",77,31," ",55,20]
bubbleSort(alist)
print(alist)
I am trying to ask the user for the list instead of storing the list in the code, but I have no idea of how to do that in Python. Would someone help me out with it.