2.4 Code Practice: Question 1

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.

Relax

Respuesta :

Answer:

num = float(input("Enter a number : "))

ab = abs(num)

sqrt = float(ab ** 0.5)

print(sqrt)

Explanation: