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
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
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)
python how to find the highest even in a list
def highest_even(li):
evens = []
for item in li:
if item % 2 == 0:
evens.append(item)
return max(evens)
print(highest_even([10,2,3,4,8,11]))
# Building a function to find the highest even number in a list
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us