Assignment 6
Assignment 6
Assignment 6
ROLL NO-19
print("SELECTION SORT:")
for i in range (1,n+1):
per=float(input("percentage of student:"))
L.append(per)
size=len(L)
elif(ch==2):
print("BUBBLE SORT:")
for i in range (1,n+1):
per=float(input("Enter percentage of students:"))
L.append(per)
size=len(L)
print("Original list is:")
print(L)
else:
break;
OUTPUT:
Enter no of students in fe:5
1.selection sort
2.Bubble sort
3.exit
1
SELECTION SORT:
percentage of student:87
percentage of student:56
percentage of student:44
percentage of student:87# #9
percentage of student:33
Original list is:
[87.0, 56.0, 44.0, 89.0, 33.0]
Sorted list is:
[33.0, 44.0, 56.0, 87.0, 89.0]
1.selection sort
2.Bubble sort
3.exit
2
BUBBLE SORT:
Enter percentage of students:88
Enter percentage of students:67
Enter percentage of students:45
Enter percentage of students:33
Enter percentage of students:23
Original list is:
[33.0, 44.0, 56.0, 87.0, 89.0, 88.0, 67.0, 45.0, 33.0, 23.0]
Sorted list is:
[33.0, 44.0, 56.0, 87.0, 88.0, 67.0, 45.0, 33.0, 23.0, 89.0]
Sorted list is:
[33.0, 44.0, 56.0, 87.0, 67.0, 45.0, 33.0, 23.0, 88.0, 89.0]
Sorted list is:
[33.0, 44.0, 56.0, 67.0, 45.0, 33.0, 23.0, 87.0, 88.0, 89.0]
Sorted list is:
[33.0, 44.0, 56.0, 45.0, 33.0, 23.0, 67.0, 87.0, 88.0, 89.0]
Sorted list is:
[33.0, 44.0, 45.0, 33.0, 23.0, 56.0, 67.0, 87.0, 88.0, 89.0]
Sorted list is:
[33.0, 44.0, 33.0, 23.0, 45.0, 56.0, 67.0, 87.0, 88.0, 89.0]
Sorted list is:
[33.0, 33.0, 23.0, 44.0, 45.0, 56.0, 67.0, 87.0, 88.0, 89.0]
Sorted list is:
[33.0, 23.0, 33.0, 44.0, 45.0, 56.0, 67.0, 87.0, 88.0, 89.0]
Sorted list is:
[23.0, 33.0, 33.0, 44.0, 45.0, 56.0, 67.0, 87.0, 88.0, 89.0]
Sorted list is:
[23.0, 33.0, 33.0, 44.0, 45.0, 56.0, 67.0, 87.0, 88.0, 89.0]
1.selection sort
2.Bubble sort
3.exit
3