To write a program to find the maximum of a list of numbers.
- Hardware – PCs
- Anaconda – Python 3.7 Installation / Moodle-Code Runner
- Get the list of marks as input
- Use the sort() function or max() function or use the for loop to find the maximum mark.
- Return the maximum value
Program to mark the maximum of marks using the list method sort
Developed by: Narendran.k
RegisterNumber: 23013500
'''
def max_marks(marks):
return(max(marks))
Program to find the maximum marks using the list method max().
Developed by: Narendran.k
RegisterNumber: 23013500
'''
def max_marks(marks):
return(max(marks))
Program to the maximum marks without using builtin functions.
Developed by: Narendran.k
RegisterNumber: 23013500
'''
def max_marks(list1):
i=list1[0]
for a in list1:
if a>i:
i=a
else:
i=i
return(i)
Thus the program to find the maximum of given numbers from the list is written and verified using python programming.