Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Printing variable name

How would I return a variable name in a function. E.g. If I have the function:

def mul(a,b):
   return a*b

a = mul(1,2); a
b = mul(1,3); b
c = mul(1,4); c

This would return:

2
3
4

I would like it to return:

a = 2
b = 3
c = 4

How would I do this?