I'm a beginner programmer and I'm trying to make an exercise.
I want to sort an integer list, but every time I run my code, the list is not sorted. I've tried it in a couple of different ways with sorted() or .sort(), but nothing seems to help.
def main():
_list1_ = []
_list2_ = []
print("Enter random numbers and enter Q to quit: ")
userInput1 = input("")
while userInput1.upper() != "Q":
_list1_.append(int(userInput1))
userInput1 = input("")
print("Enter random numbers and enter Q to quit:")
userInput2 = input("")
while userInput2.upper() != "Q":
_list2_.append(int(userInput2))
userInput2 = input("")
sorted(_list1_)
sorted(_list2_)
print(_list1_)
main()