find largest number in python code example
Example 1: python find largest variable
x = 1
y = 2
z = 3
var = {x:"x",y:"y",z:"z"}
max(var)
var.get(max(var))
var.get(min(var))
----OUTPUT----
3
z
x
Example 2: Largest number python
# This program will find out the greater number in the arguments
def larger_number(x, y):
if x > y:
print(x, "is greater")
else:
print(y, 'is greater')
larger_number(12, 31)