# Python program maximum of three

## Python program maximum of three

Given three number a b and c, the task is that we have to find the greatest element in among in given number
Examples:

```Input : a = 2, b = 4, c = 3
Output : 4

Input : a = 4, b = 2, c = 6
Output : 6```

Method 1 (Simple)

 `# Python program to find the largest` `# number among the three numbers` ` ` `def` `maximum(a, b, c):` ` ` `    ``if` `(a >``=` `b) ``and` `(a >``=` `c):` `        ``largest ``=` `a` ` ` `    ``elif` `(b >``=` `a) ``and` `(b >``=` `c):` `        ``largest ``=` `b` `    ``else``:` `        ``largest ``=` `c` `         ` `    ``return` `largest` ` ` ` ` `# Driven code ` `a ``=` `10` `b ``=` `14` `c ``=` `12` `print``(maximum(a, b, c))`

Output:

```14
```

Method 2 (Using List)
. Initialize three number by n1, n2 and n3
. Add three numbers into list lst = [n1, n2, n3].
. Using max() function to find the greatest number max(lst).
. And finally we will print maximum number

 `# Python program to find the largest number ` `# among the  three numbers using library function ` ` ` `def` `maximum(a, b, c):` `    ``list` `=` `[a, b, c]` `    ``return` `max``(``list``)` ` ` `# Driven code ` `a ``=` `10` `b ``=` `14` `c ``=` `12` `print``(maximum(a, b, c))`

Output:

```14
```

Method 3 (Using max function)

 `# Python program to find the largest number ` `# among the  three numbers using library function ` ` ` `# Driven code ` `a ``=` `10` `b ``=` `14` `c ``=` `12` `print``(``max``(a, b, c))`

Output:

`14`

Last Updated on November 13, 2021 by admin

## How to pass multiple arguments to function ?How to pass multiple arguments to function ?

How to pass multiple arguments to function ? A Routine is a named group of instructions performing

## Change the data type of a column or a Pandas SeriesChange the data type of a column or a Pandas Series

Change the data type of a column or a Pandas Series Series is a one-dimensional

## Python – Check for URL in a StringPython – Check for URL in a String

Python | Check for URL in a String In this article, we will need to

## time.perf_counter() function in Pythontime.perf_counter() function in Python

time.perf_counter() function in Python As time module provides various time-related functions. So it is necessary

## Ways to concatenate two lists in PythonWays to concatenate two lists in Python

Ways to concatenate two lists in Python Let’s see how to concatenate two lists using

## Print all sublists of a list in PythonPrint all sublists of a list in Python

Print all sublists of a list in Python Given a list, print all the sublists

## Split Pandas Dataframe by RowsSplit Pandas Dataframe by Rows

If you are working with a large Pandas dataframe, it may be useful to split

## Python – Difference between two dates (in minutes) using datetime.timedelta() methodPython – Difference between two dates (in minutes) using datetime.timedelta() method

Python | Difference between two dates (in minutes) using datetime.timedelta() method To find the difference