You haven't actually converted your strings to ints. Or rather, you did, but then you didn't do anything with the results. What you want is:

Copylist1 = ["1","10","3","22","23","4","2","200"]
list1 = [int(x) for x in list1]
list1.sort()

If for some reason you need to keep strings instead of ints (usually a bad idea, but maybe you need to preserve leading zeros or something), you can use a key function. sort takes a named parameter, key, which is a function that is called on each element before it is compared. The key function's return values are compared instead of comparing the list elements directly:

Copylist1 = ["1","10","3","22","23","4","2","200"]
# call int(x) on each element before comparing it
list1.sort(key=int)
# or if you want to do it all in the same line
list1 = sorted([int(x) for x in list1]) 
Answer from Seamus Campbell on Stack Overflow
🌐
Python documentation
docs.python.org › 3 › howto › sorting.html
Sorting Techniques — Python 3.14.6 documentation
Author, Andrew Dalke and Raymond Hettinger,. Python lists have a built-in list.sort() method that modifies the list in-place. There is also a sorted() built-in function that builds a new sorted lis...
🌐
W3Schools
w3schools.com › python › ref_func_sorted.asp
Python sorted() Function
The sorted() function returns a sorted list of the specified iterable object. You can specify ascending or descending order. Strings are sorted alphabetically, and numbers are sorted numerically.
Discussions

sorting list of strings that start with numbers
First, make a function that extracts the information you want to use to sort by. Then you can use that function as a sort key. def get_number(data): return int(data.split()[0]) Rankings = ["1174 apple", "22 banana", "3 pear"] Sorted_rankings=sorted(Rankings, key=get_number) We commonly use a lambda function for this, but for beginners I'd recommend a normal function, for readability. Lambda functions tend to be hard for beginners to read and write, and python does not care which you use. More on reddit.com
🌐 r/learnpython
5
13
January 5, 2023
How do I sort the numbers in a given string?
This is challenging for a couple of reasons. For one, you aren’t sorting the digits, you are sorting series of consecutive digits (ie 14 was sorted, not 1 and 4. I think regex would be helpful to find the groups of digits, then sort them and replace the groups with the right number. More on reddit.com
🌐 r/learnpython
14
16
September 11, 2022
array - Sort numbers in ascending order using Python - Code Review Stack Exchange
This is Python code to sort the numbers in ascending order (It's my school task). How does it look? It works, but I think that this can be improved. # How many number we have to sort num = int(... More on codereview.stackexchange.com
🌐 codereview.stackexchange.com
October 19, 2017
sorted() vs sort()
That’s the thing. sort doesn’t return anything. You’re comparing None to a list. There’s nothing to compare there. You need to sort first then compare numbers == sorted(numbers). More on reddit.com
🌐 r/learnpython
15
4
February 28, 2025
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-list-sort-method
Python List sort() Method - GeeksforGeeks
December 20, 2025 - Python · a = [4, 1, 3, 2] a.sort() print(a) Output · [1, 2, 3, 4] Explanation: a.sort() arranges the list elements in increasing order, a is updated with the sorted values. lst.sort(key=None, reverse=False) Parameters: key (optional): A function ...
🌐
Mimo
mimo.org › glossary › python › list-sort()
Python List sort(): Master Data Sorting | Learn Now
# Creating a list of numbers and sorting them numbers = [5, 2, 9, 1] numbers.sort() # Sorts the numbers in ascending order print(numbers) # Outputs: [1, 2, 5, 9] You can sort the list in descending order by passing reverse=True as an argument: ... This method sorts the list based on the specified ...
🌐
Real Python
realpython.com › python-sort
How to Use sorted() and .sort() in Python – Real Python
February 24, 2025 - You don’t have to define the sorted() function. It’s a built-in function that’s available in any standard installation of Python. You’re ordering the values in numbers from smallest to largest when you call sorted(numbers).
Find elsewhere
🌐
Hyperskill
hyperskill.org › university › python › sorting-and-sort-in-python
Python sort() and sorted(): Sort Lists, Strings & Dicts
2 weeks ago - The Python sort() function is used to sort elements in a list. By default, it arranges elements in ascending order and modifies the original list in-place. For example, with numbers = [5, 2, 7, 1], calling numbers.sort() changes it to [1, 2, 5, 7]. The sort() function also allows sorting in ...
🌐
Reddit
reddit.com › r/learnpython › how do i sort the numbers in a given string?
r/learnpython on Reddit: How do I sort the numbers in a given string?
September 11, 2022 -

EX: string="abcd7efgh14ijkl5mn3op"

how can i sort it to be "abcd3efgh5ijkl7mn14op"

Top answer
1 of 6
20
Maybe like this: import re string = "abcd7efgh14ijkl5mn3op" parts = re.split(r"(\d+)", string) # ['abcd', '7', 'efgh', '14', 'ijkl', '5', 'mn', '3', 'op'] parts[1::2] = sorted(parts[1::2], key=int) result = "".join(parts) print(result) The string is split into parts by numbers in it. \d means a digit. + means one or more. Because it's put into capture group (), the separators (numbers) are included into parts. r before "" means raw string, so \d is treated as two separate characters by Python interpreter, not single symbol, like \n (new line) symbol, for example. Then each second part is sorted by using by using its integer form to compare against other parts. The sorted parts are put in place of old parts (each second part). In the end, parts are joined back using empty string as the separator. The result is then to be printed. Check "Change a Range of Item Values" on https://www.w3schools.com/python/python_lists_change.asp https://docs.python.org/3/library/functions.html#sorted https://docs.python.org/3/library/stdtypes.html?highlight=str%20join#str.join https://docs.python.org/3/library/re.html?highlight=re%20split#re.split More on RegEx on https://www.w3schools.com/python/python_regex.asp https://docs.python.org/3/howto/regex.html#regex-howto https://regex101.com/ (select Python flavor)
2 of 6
17
This is challenging for a couple of reasons. For one, you aren’t sorting the digits, you are sorting series of consecutive digits (ie 14 was sorted, not 1 and 4. I think regex would be helpful to find the groups of digits, then sort them and replace the groups with the right number.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-sort-numeric-strings-in-a-list
Sort Numeric Strings in a List - Python - GeeksforGeeks
July 11, 2025 - For example, if we have: a = ["10", "2", "30", "4"] then the expected output should be: ["2", "4", "10", "30"] because numerically, 2 < 4 < 10 < 30. We use Python's built-in sorted() function along with the key=int parameter as this converts ...
🌐
freeCodeCamp
freecodecamp.org › news › python-sort-how-to-sort-a-list-in-python
Python .sort() – How to Sort a List in Python
March 8, 2022 - As mentioned earlier, by default, sort() sorts list items in ascending order. Ascending (or increasing) order means that items are arranged from lowest to highest value. The lowest value is on the left hand side and the highest value is on the right.
Top answer
1 of 3
2

You could combine your input to a single line to improve ease of use. For example,

storage = input("Enter values separated by spaces:")
storage = [int(x) for x in storage.split()]

This way you have the entire list of input and can avoid having to have the user enter the number of input, and avoid having to declare the num variable at all.

However, you probably also want to include some form of input validation or throw a meaningful error as right now if your user was to enter non-integers, your program would simply crash and output a vague error that the user would probably have a difficult time understanding.

try: 
    storage = [int(x) for x in test.split()]
except ValueError:
    print("Non-integers in input!")

Alternatively, you could check if all the values are numeric and if not, have the user re-enter their input.

As for your sorting algorithm, if you don't want to use Python's implemented sort() or sorted(), you should research more efficient algorithm's such as quick sort or even implement the bubble sort that you learned.

Currently, your min_sort algorithm finds the minimum value in the list, which is O(n) then removes that element from the list (separately from the search) which is again O(n). This is extremely wasteful as you may end up searching through the entire list again and again (n times), so it would be better to use a more efficient sorting algorithm or at least recognize that we don't need to pass through the entire list twice on each iteration, just pass through the list once and keep track of the minimum value. You could do this by writing your own function like:

def find_remove_min(nums):
    """Returns the minimum number and the list without the min number"""
    if nums:
        min_index = 0
        for i in range(1, len(nums)):
            if nums[i] < nums[min_index]:
                min_index = i
        return nums[min_index], nums[:min_index] + nums[min_index+1:]

Then you could do something like,

while storage:
    min_num, storage = find_remove_min(storage)
    result.append(min_num)

which would be more readable and efficient imo.

2 of 3
2

The built-in sorted(), which uses Timsort, is always preferable, but since you said you were learning bubble sort, I would stick with it even though it is too slow and mutate the input list instead of creating a new one.

numbers = input("Enter numbers separated by a comma: ")
numbers = [int(n) for n in numbers.split(',')]

end = len(numbers) - 1

while end != 0:

    for i in range(end):
        if numbers[i] > numbers[i + 1]:
            numbers[i], numbers[i + 1] = numbers[i + 1], numbers[i]

    end = end - 1

Running it:

Enter numbers separated by a comma: 3, 0, 1, 4, 2
[0, 1, 2, 3, 4]
>>> 
🌐
Google
developers.google.com › google for education › python › python sorting
Python Sorting | Python Education | Google for Developers
The easiest way to sort is with the sorted(list) function, which takes a list and returns a new list with those elements in sorted order.
🌐
Reddit
reddit.com › r/learnpython › sorted() vs sort()
r/learnpython on Reddit: sorted() vs sort()
February 28, 2025 -

So I get that one of the main differences between sorted() and sort() is that sorted() returns a new list and sort() modifies the list directly. But I don't understand why their outputs can't be exactly equal if they print out to being, in fact, exactly equal. For example:

numbers = [3, 1, 4, 1, 5, 9, 2]

sorted_numbers = sorted(numbers)
print(f"Sorted list: {sorted_numbers}")

numbers.sort()
print(f"Sorted list: {numbers}")

print(numbers.sort() == sorted(numbers))

This is the output:

Sorted list: [1, 1, 2, 3, 4, 5, 9]
Sorted list: [1, 1, 2, 3, 4, 5, 9]
False

As we can see, both sorted(numbers) and numbers.sort return what appears to be identical output: [1, 1, 2, 3, 4, 5, 9]. Of course, sort() has modified the original list, so that object has been changed by the end of the program. But if these two outputted lists are clearly identical from a mathematical perspective (ie: [1, 1, 2, 3, 4, 5, 9] == [1, 1, 2, 3, 4, 5, 9] is true on it's on terms as a standalone expression ) - then why won't Python embrace this apparently same understanding with: print(numbers.sort() == sorted(numbers))?

Is there some unseen object that represents the original list that is lingering unprinted in the background and attached to sorted(numbers)?

Thanks ahead of time for your interest and time on this matters.

🌐
Bioinformaticist
bioinformaticist.com › 2018 › 11 › python-how-to-sort-python-list-string_15.html
[Python] How to sort python list string with number inside? - How to write natrual sort order in python? ~ Bioinformaticist
In this way, list item with "string" + "number" can be sorted by lst.sort(key=lambda x: int(x[4:])). [Line 12] ... Python List.sort() method, Key Functions.
🌐
Medium
medium.com › @pythonchallengers › python-challenge-descending-order-8f44fc2463e1
Python Challenge: Sorts digits of a number in descending order | by Python Challengers | Medium
December 6, 2023 - The string of digits is converted into a list of individual characters using the list() function. This list is assigned to the data variable. The sorted() function is used to sort the data list in ascending order (smallest to largest) by default.
🌐
Programiz
programiz.com › python-programming › methods › built-in › sorted
Python sorted()
# sorting the numbers in descending order sorted_numbers = sorted(numbers, reverse=True) print(sorted_numbers) # Output: [13, 11, 9, 7, 3, 2] Here, sorted(iterable, reverse = True) sorts the list in descending order. The sorted() method accepts another optional parameter- the key function. ...
🌐
Python documentation
docs.python.org › 3 › library › stdtypes.html
Built-in Types — Python 3.14.6 documentation
The result of bitwise operations ... infinite number of sign bits. The priorities of the binary bitwise operations are all lower than the numeric operations and higher than the comparisons; the unary operation ~ has the same priority as the other unary numeric operations (+ and -). This table lists the bitwise operations sorted in ascending ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › sort-in-python
sort() in Python - GeeksforGeeks
The sort() method in Python is used to arrange the elements of a list in a specific order. It works only on lists, modifies the original list in place, and does not return a new list.
Published   January 13, 2026
🌐
Vultr Docs
docs.vultr.com › python › built-in › sorted
Python sorted() - Sort Iterable | Vultr Docs
November 22, 2024 - Setting reverse=True sorts the list numbers in descending order, producing [8, 5, 3, 2, 1]. The sorted() function in Python provides a straightforward yet powerful way to order elements from any iterable.