from math import * def calcMg(a,b): return sqrt(a*b) a=3.4 b=6.7 print "mg=%f" % (calcMg(a,b))