# mathlib.py # Neal Nelson # 2009.10.12 # # Experiments with the python math library # BUG: cube roots here aren't very accurate import math def main(): n1,n2,n3 = input("Enter three numbers separated by commas: ") print "square roots: ", math.sqrt(n1), math.sqrt(n2), math.sqrt(n3) print "square roots: ", n1 ** 0.5, n2 ** 0.5, n3 ** 0.5 print "cube roots: ", n1 ** 0.33, n2 ** 0.33, n3 ** 0.33 print "pi and e ", math.pi, math.e print "log and log10 of first two numbers: ", math.log(n1), math.log10(n2) main()