Basic program to find maximum of two numbers in python using function. In this program, we can execute the python program to check the greatest or largest number in python using function.
Function Definition in Python
A function is a piece of code that only executes when called. If a return statement is given, Python functions return a value. After a function has been declared, it can be invoked from anywhere. The “def ” command is followed by the function name and parentheses (()) in Python to define a function.
max() Function in Python
The max() method returns the highest-valued item or the highest-valued item in an iterable. The max() method in Python returns the most significant item in an iterable or the most significant of two or more inputs.
Maximum of Two Numbers in Python Using Function
a = 2
b = 4
maximum = max(a, b)
print(maximum)
Output:
4
Maximum of Two Numbers in Python Using Function
C Program to Find Armstrong Number Using Recursion
Linear Search in C Program Using Array
Insertion Sort Program in C Using Array
Bubble Sort Program in C Using Function
Bubble Sort in C Program Example
Binary Search in C Program Using Function
Prime or Not in C Using Function