Find Maximum of two numbers in Python


Given two numbers, write a Python code to find the Maximum of these two numbers.

Examples:

Input: a = 2, b = 4
Output: 4

Input: a = -1, b = -4
Output: -1

CODE:

Python program to find the

maximum of two numbers

def maximum(a, b):

if a >= b:
    return a
else:
    return b

Driver code

a = 2
b = 4
print(maximum(a, b))