🌐
GeeksforGeeks
geeksforgeeks.org › python › sort-a-list-in-python-without-sort-function
Sort a list in Python without sort Function - GeeksforGeeks
July 4, 2025 - Both sublists are recursively sorted, placing larger elements first for descending order. Bubble Sort is a simple comparison-based sorting algorithm. It works by repeatedly swapping adjacent elements if they are in the wrong order.
🌐
Reddit
reddit.com › r/learnpython › sorting a list without sort
sorting a list WITHOUT sort : r/learnpython
April 8, 2020 - One of those simpler parts is the idea that the simplest possible list you could sort has only two elements. ... I don't know what recursively means... it's a list of 5 strings. ... It doesn't make sense to not be able to use a loop, the only alternative is recursion, are you sure no looping is what they want? Python allows you to compare strings so you can do a bubble sort manually
Discussions

python - Order a list of numbers without built-in sort, min, max function - Stack Overflow
If I have a list that varies in length each time and I want to sort it from lowest to highest, how would I do that? If I have: [-5, -23, 5, 0, 23, -6, 23, 67] I want: [-23, -6, -5, 0, 5, 23, 23... More on stackoverflow.com
🌐 stackoverflow.com
Sort a list without using sort() in python with explanation.
A Python list needs Bubble Sort implementation to achieve sorting even when not using sort() function. Bubble Sort functions through a straightforward approach that moves across the list sequence to check adjacent elements and swaps them when the first one is greater than the second. More on mindstick.com
🌐 mindstick.com
0
April 25, 2025
sorting a list in python without the sorted function - Stack Overflow
I am new to python programming. could you explain why two for loops are used here? . I know this is a silly question. but I am not able to get the concept. 2015-02-24T06:07:30.247Z+00:00 ... @ElizabethSusanJoseph: Don’t worry; it doesn’t really make sense. The inner loop is a bubble sort, and the outer loop runs the bubble sort the absolute maximum number of times it’d take to sort the list ... More on stackoverflow.com
🌐 stackoverflow.com
sort function without .sort or sorted()

Is there a particular reason why you can't use those, or do you simply have the impression that you cannot use them for 2D lists? Because you totally can.

EDIT: Your explanation sounds a bit confusing, but if what you're really asking about is sorting a list of strings, that should already be as simple as

strings = [...]
sorted_strings = sorted(strings)

By default they'd be in lexicographical order, but if you want to sort by a different criteria, simply supply a boolean filter function to sorted via the key parameter.

More on reddit.com
🌐 r/learnpython
6
2
November 19, 2022
People also ask

Q2. Can we sort a list without sort()?
Yes, a list can be sorted manually using loops, swapping, or sorting algorithms like Bubble Sort, Selection Sort, and Insertion Sort.
🌐
intellipaat.com
intellipaat.com › home › blog › how to sort a list in python without using sort function
How to Sort A List in Python Without Using Sort Function?
Q1. Why is sorting important in Python?
Sorting organizes data, making it easier to search, retrieve, and analyze. It is widely used in databases, data science, and ranking search results.
🌐
intellipaat.com
intellipaat.com › home › blog › how to sort a list in python without using sort function
How to Sort A List in Python Without Using Sort Function?
Q5. When should I sort manually?
Manual sorting is useful for learning algorithms, customizing sorting for large datasets, or solving specific coding problems
🌐
intellipaat.com
intellipaat.com › home › blog › how to sort a list in python without using sort function
How to Sort A List in Python Without Using Sort Function?
🌐
JanBask Training
janbasktraining.com › community › python-python › how-can-i-sort-a-list-in-python-without-the-sort-function
How can I sort a list in Python without the sort function? | JanBask Training Community
January 12, 2024 - Def bubble_sort(names): N = len(names) # Traverse through all elements in the list For I in range(n – 1): # Last I elements are already in place For j in range(0, n – I – 1): # Traverse the list from 0 to n – I – 1 # Swap if the element found is greater # than the next element If names[j] > names[j + 1]: Names[j], names[j + 1] = names[j + 1], names[j] # Example list of names Students = [“Alice”, “Charlie”, “Bob”, “Eve”, “David”] # Call the bubble sort function Bubble_sort(students) # Display the sorted list Print(“Sorted list of names:”, students)
🌐
Quora
quora.com › How-do-you-sort-a-list-in-Python-without-using-the-sort-function
How to sort a list in Python without using the sort function - Quora
Quora is a place to gain and share knowledge. It's a platform to ask questions and connect with people who contribute unique insights and quality answers.
🌐
Flexiple
flexiple.com › python › sort-list-python
How to sort a list in python without the sort function - Flexiple
While Bubble Sort is straightforward, it may not be the best choice for sorting large lists. def bubble_sort(lst): n = len(lst) for i in range(n): for j in range(0, n - i - 1): if lst[j] > lst[j + 1]: lst[j], lst[j + 1] = lst[j + 1], lst[j]
🌐
Stack Overflow
stackoverflow.com › questions › 11964450 › order-a-list-of-numbers-without-built-in-sort-min-max-function
python - Order a list of numbers without built-in sort, min, max function - Stack Overflow
If I have a list that varies in length each time and I want to sort it from lowest to highest, how would I do that? ... data_list = [-5, -23, 5, 0, 23, -6, 23, 67] new_list = [] minimum = data_list[0] # arbitrary number in list for x in data_list: if x < minimum: minimum = value new_list.append(i) ... This is where I get stuck. How do I keep looping through until the len(new_list) = len(data_list) (i.e. all the numbers are in the new list) with everything sorted without using the built in max, min, sort functions?
🌐
ACTE
acte.in › home › explaining python list sorting without a sort function
Learn Python List Sorting Without Sort Function | Updated 2026
CyberSecurity Framework and Implementation Article - Python List Sorting Without Sort Function: Learn How to Sort a List in Python Without the Sort Function, Your Level of Programming Knowledge and Sorting Strategies. One of best Institute to learn CyberSecurity Framework and Implementation from ACTE . Really impressive model where you can learn technical Skills , Soft Skill and get help to kick start your first Job as well.
Rating: 5 ​
Find elsewhere
🌐
MindStick
mindstick.com › forum › 161530 › sort-a-list-without-using-sort-in-python-with-explanation
Sort a list without using sort() in python with explanation. – MindStick
April 25, 2025 - A Python list needs Bubble Sort implementation to achieve sorting even when not using sort() function. Bubble Sort functions through a straightforward approach that moves across the list sequence to check adjacent elements and swaps them when ...
🌐
Freak Learn
freaklearn.com › home › how can you sort a list in python without using the sort function?
How Can You Sort a List in Python Without Using the Sort Function?
May 11, 2025 - It encourages them to think critically ... I sort a list in Python without using the built-in sort function? You can implement sorting algorithms such as Bubble Sort, Selection Sort, or Insertion Sort to sort a list manually....
🌐
Java Guides
javaguides.net › 2023 › 11 › python-program-to-sort-list-without-sort-function.html
Python Program to Sort a List Without sort Function
November 6, 2023 - We'll explore a simple sorting algorithm called the bubble sort, which repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.
🌐
Talkerscode
talkerscode.com › howto › how-to-sort-a-list-in-python-without-sort-function.php
How To Sort A List In Python Without Sort Function
July 1, 2023 - You can do the sorting without the built-in sort() function as well, which is provided by Python.
🌐
Codemonkeyworkshop
codemonkeyworkshop.com › lists › how-to-sort-a-list-in-python-without-sort-function
Sorting Lists in Python without the Sort Function
Merge the sorted sublists together in sorted order using the merge() function. In this article, we have explored how to sort lists in Python without using the built-in sort() function. We implemented three different sorting techniques: bubble sort, insertion sort, and merge sort.
🌐
Brainly
brainly.in › computer science › secondary school
how to sort a list in python without sort function - Brainly.in
December 31, 2022 - Here is an example of how to implement bubble sort in Python: ... Selection sort: This is another simple sorting algorithm that repeatedly finds the minimum element in the unsorted portion of the list and moves it to the sorted portion.
🌐
Python documentation
docs.python.org › 3 › howto › sorting.html
Sorting Techniques — Python 3.14.7 documentation
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 list from an iterable.
🌐
Python Help
pythonhelp.org › python-lists › how-to-sort-a-list-in-python-without-sort-function
How to Sort a List in Python Without Using sort() Function
Using Built-In Sort Functions: The simplest method for sorting in Python is by using built-in functions such as sorted(). This function does not modify the original list but returns a new, sorted list.
🌐
CodeGenes
codegenes.net › blog › how-to-sort-a-list-in-python-without-sort-function
Sorting a List in Python Without Using the `sort` Function — codegenes.net
For larger lists, more efficient algorithms like quicksort or mergesort (which can also be implemented without using the built-in sort function) are preferred. Avoid Unnecessary Swaps: Minimize the number of swaps in your sorting algorithm, ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › sort-a-list-in-python-without-sort-function
Sort a list in Python without sort Function - GeeksforGeeks
July 4, 2025 - Both sublists are recursively sorted, placing larger elements first for descending order. Bubble Sort is a simple comparison-based sorting algorithm. It works by repeatedly swapping adjacent elements if they are in the wrong order.
🌐
Intellipaat
intellipaat.com › home › blog › how to sort a list in python without using sort function
How to Sort A List in Python Without Using Sort Function?
November 3, 2023 - Now let’s sort a list in descending order using a for loop, without using the sort() function. ... Code Copied! ... Explanation: Here, a predefined list is sorted in descending order using the for loop, and the sorted list is displayed.