In a class test teacher announces the marks (negative marking is allowed) of n students a student can achieve maximum 100 marks. Write a python function p-marks (*marks) that takes number of students, marks of students and return the marks and check the marks are valid or not. If valid then it calls the recursive function rec-sort(*marks) which returns the students marks as comma separated string with elements in ascending order (you can use built in function max or min to do this). Specify the input in fixed form do not use input function.
print("print students marks in ascending order")
# create an empty dictionary
#D = {}
#def rec_sort(*marks):
#p = 5;
# create a list
marks= [-4, 84, 99, 76, 55]
#if marks <=100:
# students marks = marks.sort()
#else:
# marks >1
# students marks = Invalid
# return rec_sort(*marks)
print(marks)
Comments
Leave a comment