# 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
```

## Recommended: Please try your approach on {IDE} first, before moving on to the solution.

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
```

My Personal Notes arrow_drop_up Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Improved By : ljfects

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.