How Can We Help?
Introduction:
In this tutorial, we are going to explain how to use Python list max function with basic syntax and many examples for better understanding.
Python list max is used to get a maximum value of a list.
Syntax:
max(list_variable_name)
Input Parameters:
- list_variable_name : where tuple is a list variable whose maximum value needs to be found.
Example
number=[1,2,3] alphanumeric=['x','A','a'] # maximum value of list print('max of number:', max(number)) print('max of alphanumeric:', max(alphanumeric))
Output
max of number: 3
max of alphanumeric: x
In the above Example, If comparing values of list variable ‘number’ ,value ‘3’ is larger than value ‘1’ and ‘2’ so output of max(number) is ‘3’ and for list variable ‘alphanumeric’, let’s take ASCII code of list values(x,A,a) is (120, 65,97) respectively. If comparing ASCII values, 120 is larger than 65 and 97 so output of max(alphanumeric) is 120 which is indicated by ‘x’.
In this tutorial, you have learned how to use python list max() function.
Hopefully, it was clear and concise.
If you have a inquiry or doubt don’t hesitate to leave them in comment. we are waiting your feedback as well.
Similar Python list max Function:
- lists : is a form of data collection where different type of data can be stored and separated by commas(,).
- min(list) : It returns a minimum value of a list.
- type(list) : It returns a maximum value of a list.
- len(list) : It returns type of list , if passed variable is a list.
- list(seq) : It converts a sequence/string into a list.
- del(list) : It deletes whole list or individual list element or all element of a list.
Python tutorials list:
- Python tutorials list : access all python tutorials.