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.


Expert's answer

import math
n = float(input("Enter the number N: "))
print("The square root of N is", math.sqrt(abs(n)))
LATEST TUTORIALS
APPROVED BY CLIENTS