Q:

Python : function to find maximum even digit in string

Hoping to find a way so the function returns the maximum/biggest even digit in (st) as a result and if (st) does not have an even digit, the function returns -3 as a result.  All/any help is greatly appreciated.  The code below was my attempt at it and does not get the result i'm hoping for, just starting to learn how to use python.  Thank you.  I'm using python 3.6 
def maximumeven(st):
    Result = 0
    for i in (st):
        if i.isdigit():
            if (int(i) % 2 == 0):
                Result = Result + int(max(i))
            return Result
print(maximum("124A2"))

A:

If you really just want the biggest even digit, then since there are only five single-digit even numbers, I'd just use:
def maximumeven(st):
    if "8" in st:
        return 8
    if "6" in st:
        return 6
    if "4" in st:
        return 4
    if "2" in st:
       return 2
    if "0" in st:
       return 0

    return -3

print(maximumeven("124A2")) #4
print(maximumeven("13579")) #-3
print(maximumeven("2468")) #8

A much more efficient solution that only iterates over the string once and exits early if 8 is reached:
def maximumeven(st):
    largest = - 3
    for i in st:
        if i in '02468' and int(i) >largest:
            largest = int(i) 
        if largest == 8:
            break
    return largest

