#accept a number N from user and print the square root of all numbers between 1 and Nimport math #importing math module to use for finding square root
n=int(input("Enter the number n: "))
print("Square roots of all numbers between 1 and",n,"are")
for i in range(1,n+1):
a=math.sqrt(i)
print(a)
Comments
Post a Comment