I'm dabbling around in Python and wrote a short program which returns the square root of a number provided by the user. The output, respectively the print line, looks like this:
print 'The square root of %d is %.2f' % (x, math.sqrt(x))
with x as the user input.
My question: how could i adjust the results number of decimals via user input?
Thanks a lot!