Practical No. 6
Practical No. 6
Class: SE
Div: C
Batch: C3
Problem Statement: Write a python program to store first year percentage of students in array. Write
function for sorting array of floating point numbers in ascending order using quick sort and display
top five scores.
Program Code:
Args:
""" if low
< high:
quick_sort(percentages, low, pi - 1)
quick_sort(percentages, pi + 1, high)
Returns:
""" pivot =
percentages[high] i = low -
percentages[i + 1] return i + 1
def display_top_five(percentages):
percentages.
print(percentages[i])
def main():
# Main program
num_students = int(input("Enter the number of students: "))
percentages = []
for i in range(num_students):
percentages.append(percentage)
quick_sort(percentages, 0, len(percentages) - 1)
display_top_five(percentages)
if __name__ == "__main__":
main()
Output: