 # 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

## Accessing elements of a Pandas SeriesAccessing elements of a Pandas Series

Accessing elements of a Pandas Series Pandas Series is a one-dimensional labeled array capable of holding data of any type (integer, string, float, python objects, etc.). Labels need not be unique but must be a hashable type. An element in

## Python Regex: re.search() VS re.findall()Python Regex: re.search() VS re.findall()

Python Regex: re.search() VS re.findall() A Regular expression (sometimes called a Rational expression) is a sequence of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. “find and replace”-like operations. Regular expressions are

## Python program to check if string is empty or notPython program to check if string is empty or not

Python program to check if string is empty or not Python strings are immutable and hence have more complex handling when talking about its operations. Note that a string with spaces is actually an empty string but has a non-zero

## Python – Get values of particular key in list of dictionariesPython – Get values of particular key in list of dictionaries

Python | Get values of particular key in list of dictionaries Sometimes, we may require a way in which we have to get all the values of specific key from a list of dictionary. This kind of problem has a

## Python Pandas – get_dummies() methodPython Pandas – get_dummies() method

Python Pandas – get_dummies() method   pandas.get_dummies() is used for data manipulation. It converts categorical data into dummy or indicator variables. syntax:  pandas.get_dummies(data, prefix=None, prefix_sep=’_’, dummy_na=False, columns=None, sparse=False, drop_first=False, dtype=None) Parameters: data: whose data is to be manipulated. prefix: String

## Python PIL – Image.crop() methodPython PIL – Image.crop() method

Python PIL | Image.crop() method PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. PIL.Image.crop() method is used to crop a rectangular portion of any image. Syntax: PIL.Image.crop(box = None) Parameters:  box – a 4-tuple defining

## Python | Pandas dataframe.max()Python | Pandas dataframe.max()

Pandas dataframe.max() Pandas dataframe.max() function returns the maximum of the values in the given object. If the input is a series, the method will return a scalar which will be the maximum of the values in the series. If the

## Accessing Attributes and Methods in PythonAccessing Attributes and Methods in Python

Accessing Attributes and Methods in Python Attributes of a class are function objects that define corresponding methods of its instances. They are used to implement access controls of the classes. Attributes of a class can also be accessed using the