Thanks G-Do! I think you gave me a good hint where i went wrong. Here is my error prone code:

# a dictionary of functions by bumsfeld
# get errors = TypeError: 'int' object is not callable
def add(a, b):
return a + b
def sub(a, b):
return a - b
def mul(a, b):
return a * b
def div(a, b):
return a / b
a = b = 1
mathD = {
'+' : add(a, b),
'-' : sub(a, b),
'*' : mul(a, b),
'/' : div(a, b)
}
f = mathD['+']
print f(99, 13)

G-Do did give you the hint, don't call the functions from the dictionary, just reference them. I took the liberty to play with your code a little ...

def add(a, b):
return a + b
def subtract(a, b):
return a - b
def multiply(a, b):
return a * b
def divide(a, b):
if b == 0:
print "divide by zero error"
else:
return a / b
# use the function reference, not the actual call
mathD = {
'+' : add,
'-' : subtract,
'*' : multiply,
'/' : divide
}
f = mathD['+']
print f(99, 13)
# or simpler ...
print mathD['+'](99, 13)
# maybe less cryptic ...
def calc(math_op, a, b):
return mathD[math_op](a, b)
# now you can use ...
print calc('/', 355, 113.0)

That is not necessarily the OP's actual question,
(does not even have a dictionary of functions)
but I was facing the problem that I needed something like the calc function
that vegaseat suggested and this is what I came up with:

When I execute this progammatically, I get a table with row heights much larger than when I do this manually.

Note : Sel is the Word.Selection object and the Clipboard contains an Excel Table.

public void AddClipboard()
{
Sel.PasteExcelTable(false,false, false);
var t = Sel.Tables[Sel.Tables.Count];
t.AutoFitBehavior(Word.WdAutoFitBehavior.wdAutoFitContent);
}

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...