Bubble Sort in Python

Bubble Sort in Python

In this program, you will learn and get the program code of the Bubble Sort in Python program.

Bubble Sort is an algorithm that sorts an array by repeatedly looping through the array and swapping adjacent elements if they are out of order. The name comes from the fact that elements with higher values bubble up to the top of the array.

Program:

Output:

Enter 5 numbers
Input item : 2
Input item : 4
Input item : 3
Input item : 1
Input item : 9
[‘1’, ‘2’, ‘3’, ‘4’, ‘9’]

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top