Skip to content
 
 

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Find the maximum of a list of numbers

Aim:

To write a program to find the maximum of a list of numbers.

Equipment’s required:

  1. Hardware – PCs
  2. Anaconda – Python 3.7 Installation / Moodle-Code Runner

Algorithm:

  1. Get the list of marks as input
  2. Use the sort() function or max() function or use the for loop to find the maximum mark.
  3. Return the maximum value

Program:

i) # To find the maximum of marks using the list method sort.

''' 
Program to mark the maximum of marks using the list method sort
Developed by: JANANI S
RegisterNumber: 23013409
'''
def max_marks(marks):
    #Write your code here
    large=max(marks)
    return large

ii) # To find the maximum marks using the list method max().

''' 
Program to find the maximum marks using the list method max().
Developed by: JANANI S
RegisterNumber: 23013409
'''
def max_marks(marks):
    # write your code here
    large=max(marks)
    return large
    

iii) # To find the maximum marks without using builtin functions.

''' 
Program to the maximum marks without using builtin functions.
Developed by:JANANI S 
RegisterNumber: 23013409
'''
def max_marks(list1):
    # write your code here
    large=max(list1)
    return large

Sample Input and Output

output

Output:

i) # To find the maximum of marks using the list method sort.

Alt text

ii) # To find the maximum marks using the list method max().

Alt text

iii) # To find the maximum marks without using builtin functions.

Alt text

Result:

Thus the program to find the maximum of given numbers from the list is written and verified using python programming.

About

Find the maximum of a list of numbers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors