Switch/Case - Bug Fixing #6

Oh no! Timmy's evalObject function doesn't work. He uses Switch/Cases to evaluate the given properties of an object, can you fix timmy's function?

Difficulty: introductory

Starter code:

def eval_object(v):
	

Solutions:
def eval_object(v):
    return {"+": v['a']+v['b'],
            "-": v['a']-v['b'],
            "/": v['a']/v['b'],
            "*": v['a']*v['b'],
            "%": v['a']%v['b'],
           "**": v['a']**v['b'], }.get(v['operation'])

def eval_object(v):
    return eval("{a}{operation}{b}".format(**v))

def eval_object(v):
    return eval(str(v['a'])+v['operation']+str(v['b']))

eval_object = lambda v: eval("{}{}{}".format(v['a'],v['operation'],v['b']))

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'] }.get(v.get('operation'),1)

def eval_object(v):
    return {
        "+" : v['a'] +  v['b'],
        "-" : v['a'] -  v['b'],
        "/" : v['a'] /  v['b'],
        "*" : v['a'] *  v['b'],
        "%" : v['a'] %  v['b'],
        "**": v['a'] ** v['b'], 
    }.get(v['operation'])

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "^": 1,
        "**": v['a']**v['b']}[v['operation']]

from operator import add, sub, truediv, mul, mod, pow
ops = {'+':add, '-':sub, '/':truediv, '*':mul, '%':mod, '**':pow}
one = lambda a,b: 1

def eval_object(v):
    return ops.get(v['operation'], one)(v['a'], v['b'])

from typing import Dict, Union

def eval_object(v: Dict[str, Union[str, int]]) -> int:
    """ Make a math operation based on `v` object. """
    return {
        "+": v["a"] + v["b"],
        "-": v["a"] - v["b"],
        "/": v["a"] / v["b"],
        "*": v["a"] * v["b"],
        "%": v["a"] % v["b"],
        "**": v["a"] ** v["b"]
    }.get(v["operation"], 1)

def eval_object(v):
    if v['operation'] == "+":return int(v['a']) + int(v['b'])
    elif v['operation'] == "-":return int(v['a']) - int(v['b'])
    elif v['operation'] == "/":return int(v['a']) / int(v['b'])
    elif v['operation'] == "*":return int(v['a']) * int(v['b'])
    elif v['operation'] == "%":return int(v['a']) % int(v['b'])
    elif v['operation'] == "**":return int(v['a']) ** int(v['b'])

def eval_object(v):
    return {"+": int(v['a'])+int(v['b']),
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v['operation'])

def eval_object(v):
    if (v['operation'] == '+'):
        c = v['a'] + v['b']
        return c
    if (v['operation'] == '-'):
        c = v['a'] - v['b']
        return c
    if (v['operation'] == '/'):
        c = v['a'] / v['b']
        return c
    if (v['operation'] == '*'):
        c = v['a'] * v['b']
        return c
    if (v['operation'] == '%'):
        c = v['a'] % v['b']
        return c
    if (v['operation'] == '**'):
        c = v['a'] ** v['b']
        return c

def eval_object(v):
    return eval("{}{}{}".format(v["a"], v["operation"], v["b"]))

def eval_object(v):
    return eval('%s %s %s' % (v['a'], v['operation'], v['b']))

def eval_object(v):
    return eval({   "+": "v['a']+v['b']",
                    "-": "v['a']-v['b']",
                    "/": "v['a']/v['b']",
                    "*": "v['a']*v['b']",
                    "%": "v['a']%v['b']",
                   "**": "v['a']**v['b']"}.get(v['operation']))

def eval_object(v):
    if v['operation']=='+': return v['a']+v['b']
    elif v['operation']== '-': return v['a']-v['b']
    elif v['operation']== '*': return v['a']*v['b']
    elif v['operation']== '/': return v['a']/v['b']
    elif v['operation']== '**': return v['a']**v['b']
    elif v['operation']== '%': return v['a']%v['b']
    else                      : return 1
    


def eval_object(v):
    v = list(map(str, v.values()))
    return eval(v[0] + v[2] + v[1])

def eval_object(v):
    operator = v['operation']
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(operator)

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(eval('operation',v))

def eval_object(v):
     
    c = {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b']
            }
            
    if v.get('operation') == '+':
        return v.get('a') + v.get('b')
    elif v.get('operation') == '-':
        return v.get('a') - v.get('b')
    elif v.get('operation') == '*':
        return v.get('a') * v.get('b')
    elif v.get('operation') == '**':
        return v.get('a') ** v.get('b')
    elif v.get('operation') == '/':
        return v.get('a') / v.get('b')
    elif v.get('operation') == '%':
        return v.get('a') % v.get('b')
    else:
        return None

def eval_object(v):
    return {"+": v.get('a')+v.get('b'),
        "-": v.get('a')-v.get('b'),
        "/": v.get('a')/v.get('b'),
        "*": v.get('a')*v.get('b'),
        "%": v.get('a')%v.get('b'),
        "**": v.get('a')**v.get('b'), }.get(v.get('operation'),1)

def eval_object(v):
    return {"+": v['a'] + v['b'],
            "-": int(v['a'])-int(v['b']),
            "/": int(v['a'])/int(v['b']),
            "*": int(v['a'])*int(v['b']),
            "%": int(v['a'])%int(v['b']),
            "**": int(v['a'])**int(v['b'])}.get(v['operation'],1)

def eval_object(v):
#     return {"+": v['a']+v['b'],
#         "-": v['a']-v['b'],
#         "/": v['a']/v['b'],
#         "*": v['a']*v['b'],
#         "%": v['a']%v['b'],
#         "**": v['a']**v['b'], }.get(v['operation'],1)
        
    return eval("{a}{operation}{b}".format(**v))

def eval_object(v):

    x = {"+": v['a']+v['b'],
    
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
            
        "**": v['a']**v['b']}
    
    if v['operation'] in x:
    
        return x.get(v['operation'])
        


import operator
def eval_object(v):
    ops = {
        '+': operator.add,
        '-': operator.sub,
        '/': operator.truediv,
        '*': operator.mul,
        '%': operator.mod,
        '**': operator.pow
    }
    return ops.get(v.get('operation'))(v.get('a'), v.get('b'))

def eval_object(v):
    operations = {
        '+': lambda a, b: a + b,
        '-': lambda a, b: a - b,
        '/': lambda a, b: a / b,
        '*': lambda a, b: a * b,
        '%': lambda a, b: a % b,
        '**': lambda a, b: a ** b
    }
    return operations[v['operation']](v['a'], v['b'])

def eval_object(v):
    set = {
        "+": v['a'] + v['b'],
        "-": v['a'] - v['b'],
        "/": v['a'] / v['b'],
        "*": v['a'] * v['b'],
        "%": v['a'] % v['b'],
        "**": v['a'] ** v['b'] }
    return set.get(v['operation'])

def eval_object(v):
    return eval(str(v['a']) + v.get('operation') + str(v['b']))

def eval_object(operation):
    if operation['operation'] == "+":
        x = operation['a'] + operation['b']
    elif operation['operation'] == "-":
        x = operation['a'] - operation['b']
    elif operation['operation'] == "/":
        x = operation['a'] / operation['b']
    elif operation['operation'] == "*":
        x = operation['a'] * operation['b']
    elif operation['operation'] == "%":
        x = operation['a'] % operation['b']
    elif operation['operation'] == "**":
        x = operation['a'] ** operation['b']
    return x

def eval_object(v):
    switcher = {'+': "v['a']+v['b']","-": "v['a']-v['b']","/": "v['a']/v['b']", "*": "v['a']*v['b']","%": "v['a']%v['b']","**": "v['a']**v['b']" }
    return eval(switcher.get(v['operation']))

from operator import add, sub, truediv, mul, mod, pow

ops = {'+':add, '-':sub, '/':truediv, '*':mul, '%':mod, '**':pow}

def eval_object(v):
    return ops[v['operation']](v['a'], v['b'])

def eval_object(v):
    op = {"+": v['a']+v['b'],"-": v['a']-v['b'],"/": v['a']/v['b'],"*": v['a']*v['b'],
        "%": v['a']%v['b'],"**": v['a']**v['b']}
    a = v.get('operation')
    return op[a]

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v.get('operation'))
    # Flez


def eval_object(v):
    operator = {
        "+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b']
    }
    return operator[v.get('operation',1)]

def eval_object(v):
    return eval(f"{v['a']}{v['operation']}{v['b']}")

def eval_object(v):
    exp = str(v['a']) + v['operation'] + str(v['b'])
    return eval(exp)

def eval_object(v):
    operations = {
        "+": v['a'] + v['b'],
        "-": v['a'] - v['b'],
        "/": v['a'] / v['b'],
        "*": v['a'] * v['b'],
        "%": v['a'] % v['b'],
        "**": v['a'] ** v['b']
    }

    return operations.get(v['operation'], 1)


def eval_object(v):
    return eval(f"{v.get('a')}{v.get('operation')}{v.get('b')}")

def eval_object(v):
    return int(eval(str(v['a']) + v['operation'] + str(v['b'])))


def eval_object(v):
    b = v["operation"]
    a =  {"+": v['a']+v['b'],
          "-": v['a']-v['b'],
          "/": v['a']/v['b'],
          "*": v['a']*v['b'],
          "%": v['a']%v['b'],
          "**": v['a']**v['b']}
    return a[b]

def eval_object(v):
    """return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get('operation',1)"""
    if v.get("operation") == "+":
        return v.get("a") + v.get("b")
    elif v.get("operation") == "-":
        return v.get("a") - v.get("b")
    elif v.get("operation") == "/":
        try:
            return v.get("a") / v.get("b")
        except ZeroDivisionError:
            return "Can't divide by Zero"
    elif v.get("operation") == "*":
        return v.get("a") * v.get("b")
    elif v.get("operation") == "%":
        return v.get("a") % v.get("b")
    elif v.get("operation") == "**":
        return v.get("a") ** v.get("b")

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v['operation'],"No operation available")


def eval_object(v):    
    a = str(v.get('a'))
    b = str(v.get('b'))
    op = v.get('operation')
    return eval(a + op + b)

def eval_object(v):
    dict = {'+': v['a']+v['b'],
    '-': v['a']-v['b'],
    '/': v['a']/v['b'],
    '*': v['a']*v['b'],
    '%': v['a']%v['b'],
    '**': v['a']**v['b']}
    return dict.get (v.get('operation'))

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'] }.get(v['operation'],'operation')

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v['operation'])
#Solved on 3rd Oct, 2019 at 07:31 AM.


def eval_object(v):
    return {"+":lambda v:  v['a']+v['b'],
        "-": lambda v:v['a']-v['b'],
        "/":lambda v: v['a']/v['b'],
        "*":lambda v: v['a']*v['b'],
        "%": lambda v:v['a']%v['b'],
        "**": lambda v:v['a']**v['b'], }[v['operation']](v)

def eval_object(v):
    a = v['a']
    b = v['b']
    return {"+": a + b,
            "-": a - b,
            "/": a / b,
            "*": a * b,
            "%": a % b,
            "**": a**b}.get(v['operation'])

def eval_object(v):
    c = v["operation"]
    a = v["a"]
    b = v["b"]
    if c == "+": return a + b
    elif c == "-": return a - b
    elif c == "/": return a / b
    elif c == "*": return a * b
    elif c == "%": return a % b
    else: return a ** b


def eval_object(v):
    x = v.get('a')
    y = v.get('b')
    op = v.get('operation')
    return {
        "+": x+y,
        "-": x-y,
        "/": x/y,
        "*": x*y,
        "%": x%y,
        "**": x**y
    }.get(op)

def eval_object(v):
   # return {"+": v['a']+v['b'],
#         "-": v['a']-v['b'],
#         "/": v['a']/v['b'],
#         "*": v['a']*v['b'],
#         "%": v['a']%v['b'],
#         "**": v['a']**v['b'], }.get('operation',1)
    a=v.get('a')
    op=v.get('operation')
    b=v.get('b')
    all=str(a)+op+str(b)
    return eval(all)

def eval_object(v):
    a=v.get("a")
    b=v.get("b")
    op=v.get("operation")
    if op=="+":
        return a+b
    elif op=="-":
        return a-b
    elif op=="/":
        return a/b
    elif op=="*":
        return a*b
    elif op=="%":
        return a%b
    elif op=="**":
        return a**b


def eval_object(v):
    return {
        "+": v["a"] + v["b"],
        "-": v["a"] - v["b"],
        "/": v["a"] / v["b"],
        "*": v["a"] * v["b"],
        "%": v["a"] % v["b"],
        "**": v["a"] ** v["b"]
    }[v.get("operation", 1)]


eval_object = lambda v: eval("%d %s %d" % (v["a"], v["operation"], v["b"])) if v["operation"] in "**%/-+" else 1
            
            


def eval_object(v):
    a=v['a']
    b=v['b']
    c=v['operation']
    return eval('a {} b'.format(c))  #I solved this Kata on  8/27/2019  06:00 AM...#Hussam'sCodingDiary



def eval_object(v):
    return {"+": v['a']+v['b'],\
        "-": v['a']-v['b'],\
        "/": v['a']/v['b'],\
        "*": v['a']*v['b'],\
        "%": v['a']%v['b'],\
        "**": v['a']**v['b'], }.get(v['operation'])

def eval_object(v):
    Oper = {"+" :lambda a,b:a +  b,
            "-" :lambda a,b:a -  b,
            "/" :lambda a,b:a /  b,
            "*" :lambda a,b:a *  b,
            "%" :lambda a,b:a %  b,
            "**":lambda a,b:a ** b}
    return Oper[v['operation']](v['a'],v['b'])

def eval_object(v):
    return eval('%d%s%d'%(v['a'], v['operation'], v['b']))

def eval_object(v):
    print(v)
    return {
        "+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v['operation'])

def eval_object(v):
    return {"+": eval("v['a']+v['b']"),
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v['operation'],1)

eval_object = lambda v: {
    '+':  v['a'] +  v['b'],
    '-':  v['a'] -  v['b'],
    '/':  v['a'] /  v['b'],
    '*':  v['a'] *  v['b'],
    '%':  v['a'] %  v['b'],
    '**': v['a'] ** v['b']
}.get(v['operation'], 0)

def eval_object(v):
    return {"+": int(v['a'])+int(v['b']),
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }[v['operation']]

def eval_object(v):
    def add(d):
        return d['a'] + d['b']
    def subtract(d):
        return d['a'] - d['b']
    def divide(d):
        return d['a'] / d['b']
    def remainder(d):
        return d['a'] % d['b']
    def multiply(d):
        return d['a'] * d['b']
    def double_star(d):
        return d['a'] ** d['b']
    return {"+": add(v),
            "-": subtract(v),
            "/": divide(v),
            "*": multiply(v),
            "%": remainder(v),
            "**": double_star(v) }.get(v['operation'])

def eval_object(v):
    sw = {
        "+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], 
        }
    return( sw.get(v['operation']))

def eval_object(v):
        switcher ={"+": v['a']+v['b'],
                   "-": v['a']-v['b'],
                   "/": v['a']/v['b'],
                   "*": v['a']*v['b'],
                   "%": v['a']%v['b'],
                   "**": v['a']**v['b']
                   }
        return switcher.get(v['operation'],1)

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v['operation'],'error')

def eval_object(v):
    print (v)
    return {
        "+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v['operation'],0)

def eval_object(v):
    return {
        '+' : v['a']+v['b'],
        "-" : v['a']-v['b'],
        "/" : v['a']/v['b'],
        "*" : v['a']*v['b'],
        "%" : v['a']%v['b'],
        "**": v['a']**v['b']
        }.get(v['operation'],9)

import operator

def eval_object(expression):
    mathop = {
        '+': operator.add, 
        '-': operator.sub, 
        '*': operator.mul, 
        '/': operator.floordiv,
        '%': operator.mod, 
        '**': operator.pow,
    }
    if not all(isinstance(n, int) for n in (expression['a'], expression['b'])):
        return 0
    else:
        return mathop[expression['operation']](expression['a'], expression['b'])


import operator

def eval_object(v):
    return {
        '+': operator.add,
        '-': operator.sub,
        '/': operator.floordiv,
        '*': operator.mul,
        '%': operator.mod,
        '**': operator.pow,
    }[v['operation']](v['a'], v['b'])

def eval_object(v):
    return {'+': v['a'] + v['b'], '-': v['a'] - v['b'],
            '/': v['a'] / v['b'], '*': v['a'] * v['b'],
            '%': v['a'] % v['b'], '**': v['a'] ** v['b']}.\
        get(v['operation'], 1)

def eval_object(v):
    if v['operation'] == "+":
        return v['a']+v['b']
    if v['operation'] == "-":
        return v['a']-v['b']
    if v['operation'] == "*":
        return v['a']*v['b']
    if v['operation'] == "/":
        return v['a']/v['b']
    if v['operation'] == "**":
        return v['a']**v['b']
    if v['operation'] == "%":
        return v['a']%v['b']

def eval_object(z):
    a,b,op = (z[v] for v in ['a','b','operation'])
    return {'+':a+b,'-':a-b,'/':a/b,'*':a*b,'%':a%b,'**':a**b}.get(op)

def eval_object(v):
    return eval("{0}{1}{2}".format(v["a"], v["operation"], v["b"]))

eval_object = lambda v: eval("{a}{operation}{b}".format(**v))


def eval_object(v): 
    
    if v['operation'] == "+": 
        return v['a']+v['b']
    elif v['operation'] == "-": 
        return v['a']-v['b']
    elif v['operation'] == "/":
        return v['a']/v['b']
    elif v['operation'] == '*':
        return v['a']*v['b']
    elif v['operation'] == '%':
        return v['a']%v['b']
    elif v['operation'] == "**":
        return v['a']**v['b']

def eval_object(v):
    if v['operation'] == '+':
        return v['a']+v['b']
    elif v['operation'] == '-':
        return v['a']-v['b']
    elif v['operation'] == '/':
        return v['a']/v['b']
    elif v['operation'] == '*':
        return v['a']*v['b']
    elif v['operation'] == '%':
        return v['a']%v['b']
    elif v['operation'] == '**':
        return v['a']**v['b']
    else:
        return

def eval_object(v):
    output= {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b']}
    return output[v['operation']]  

def eval_object(v):
    return {"+": int(v['a']+v['b']),
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v["operation"])

def eval_object(v):
    return eval(str(v.get("a"))+ v.get("operation")+ str(v.get("b")))

def eval_object(v):
    print(v)
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b']}.get(v['operation'])

def eval_object(v):
    d = {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }
    return d.get(v['operation'])
        


from operator import add, sub, floordiv, mul, mod, pow

def eval_object(v):
    return {"+": add(v['a'],v['b']),
            "-": sub(v['a'],v['b']),
            "/": floordiv(v['a'],v['b']),
            "*": mul(v['a'],v['b']),
            "%": mod(v['a'],v['b']),
            "**": pow(v['a'],v['b'])}.get(v['operation'])

def eval_object(v):
    return {
        "+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b']
       # }.get('operation',1)
        
       }.get(v['operation'])

def eval_object(v):
    a = v['a']
    b = v['b']
    c = v['operation']
    if c == '+':
        return a + b
    elif c == '-':
        return a - b
    elif c == '*':
        return a * b
    elif c == '/':
        return a / b
    elif c == '%':
        return a % b
    elif c == '**':
        return a ** b

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'], }.get(v['operation'],2)

def eval_object(v):
    return {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b']}[v.get('operation')]

def eval_object(v):
    a = v['a']
    b = v['b']
    c = v['operation']
    if c == '+':
        return(int(a) + int(b))
    elif c == '-':
        return(int(a) - int(b))
    elif c == '/':
        return(int(a) / int(b))
    elif c == '*':
        return(int(a) * int(b))
    elif c == '%':
        return(int(a) % int(b))
    elif c == '**':
        return(int(a) ** int(b))

def eval_object(v):
    return {
        "+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b'],
    }[v['operation']]

def eval_object(v):
    a = {"+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b']}
    return a[ v['operation']  ]

def eval_object(v):
    op, a, b = v['operation'], v['a'], v['b']
    return {
        '+': a + b,
        '-': a - b,
        '/': a / b,
        '*': a * b,
        '%': a % b,
        '**': a ** b,
    }.get(op, 1)


def eval_object(v):
    return {
        "+": v['a']+v['b'],
        "-": v['a']-v['b'],
        "/": v['a']/v['b'],
        "*": v['a']*v['b'],
        "%": v['a']%v['b'],
        "**": v['a']**v['b']
        }.get(v['operation'], 0)

def eval_object(v):
    return  eval(str(v['a'])+str(v['operation'])+str(v['b']))