Skip to content

Instantly share code, notes, and snippets.

@PushkraJ99
Last active June 5, 2022 15:36
Show Gist options
  • Save PushkraJ99/49b65b7e9adffa93ed377200fec84c21 to your computer and use it in GitHub Desktop.
Save PushkraJ99/49b65b7e9adffa93ed377200fec84c21 to your computer and use it in GitHub Desktop.
Bubble Sort Using Python
#Bubble Sort using Python (Github:-PushkraJ99)
def sort (num):
for i in range (len(num)-1,0,-1):
for j in range (i):
if num [j]>num[j+1]:
temp =num[j]
num[j]=num[j+1]
num[j+1]=temp
num=[1,5,8,9,4,7,6]
print(num)
sort(num)
print(num)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment