Answer to Question #177372 in Python for efv

Question #177372

Write the code to input a number and print the square root. Use the absolute value function to make sure that if the user enters a negative number, the program does not crash.


1
Expert's answer
2021-03-31T16:23:50-0400
import math
n = float(input("Enter the number N: "))
print("The square root of N is", math.sqrt(abs(n)))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS