Hi again i have programmed a thing that asks for 2 numbers and does a series of things to it.But i want to round the square-rooted numbers to about 6 digits e.g. 5.12345. How can this be done?
Here is my code:
from math import sqrt
running = 'Y'
while 'Y' in running or 'y' in running:
#defining numbers
startn = float(raw_input('What is the starting number'))
startn2 = startn
endn = float(raw_input('What is the ending number?'))
endn2 = endn
#defining lists
num = []
nums = []
numsq = []
while startn2 != (endn2+1):
#just the numbers
a = int(startn2)
num.append(a)
startn2+=1
startn2 = startn
print 'numbers without changing are:', num
while startn2 != (endn2+1):
#numbers squared
a = int(startn2*startn2)
nums.append(a)
startn2+=1
startn2 = startn
print 'numbers squared are:', nums
while startn2 != (endn2+1):
#numbers square-rooted
#Here is my problem, i want to simplify it to about 6 digits e.g. 5.12345
a = sqrt(startn2)
numsq.append(a)
startn2+=1
startn2 = startn
print 'numbers square-rooted are:', numsq
running = raw_input('Try another set? (Y or N)')