Calculator that is part of a multipurpose program I am currently working on a Python project.  It is some sort of a hub, where you can do some cool but basic stuff, such as: setting timers, launching websites, doing basic math, ping and view source codes of URLs, and more.

I want to make this code just a little more compact. I especially want my math menu more compact because I feel there is a way of doing it.  I just can't seem to figure it out.

…
elif userIn == ("math"):
    op = str(input("    * Enter operation (+, -, *, /, exp, sqrt, log): "))
    blank()
    if op==("+") or op==("-") or op==("*") or op==("/") or op==("exp"):
        input_1 = int(input("       * Enter first number:  "))
        blank()
        input_2 = int(input("       * Enter second number: "))
        blank()
    if op == ("+"):
        print ("       &gt; "+str(input_1 + input_2))
        blank()
    elif op == ("-"):
        print ("       &gt; "+str(input_1-input_2))
        blank()
    elif op == ("*"):
        print ("       &gt; "+str(input_1*input_2))
        blank()
    elif op == ("/"):
        print ("       &gt; "+str(input_1/input_2))
        blank()
    elif op == ("exp"):
        print ("       &gt; "+str(input_1**input_2))
        blank()
    elif op == ("sqrt"):
        oneInput=int(input("        * Enter number: "))
        blank()
        print ("       &gt; "+str(math.sqrt(oneInput)))
        blank()
    elif op == ("log"):
        input_1 = int(input("       * Enter number:  "))
        blank()
        input_2 = int(input("       * Enter base: "))
        blank()
        print ("       &gt; "+str(int((math.log(input_1, input_2)))))
        blank()


Link to the code (pastebin).

Note: I have tried setting a basic for loop run through a list of operation symbols, and it would set the operation if the user op. was matched.  But, as it turns out, I just couldn't use strings as math operators in the code itself. 

opl=["+", "-", "*", "/"]
for i in range(len(opl)):
    userInput1 (some way of setting op)     userInput2
I would suggest using a dict as switch-statement like structure. 

First some global helper functions/data structures:

math_dict_binary = {'+': lambda a, b: a+b,
                    '-': lambda a, b: a-b,
                    # fill out the rest of you binary functions
                   }
math_dict_uniary = {'sqrt': math.sqrt,
                    # rest of you uniary
                   }


def get_input(str_prompt):
    input = int(input("       * {}:  ".format(str_prompt)))
    blank()
    return input


in your main body:

elif userIn == ("math"):
    op = str(input("    * Enter operation (+, -, *, /, exp, sqrt, log): "))
    blank()
    if op in math_dict_binary:
        input_1 = get_input("Enter first number")
        input_2 = get_input("Enter second number")
        print( "    " + str(math_dict_binary[op](input_1, input_2)))
    elif op in math_dict_uniary:
        input_1 = get_input("Enter number")
        print( "    " + str(math_dict_uniary[op](input_1)))
    else:
        print("Not a vlaid math option")
        # deal with it