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. How do I do this in python ???

Relax

Respuesta :

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

print(abs(num)**0.5)

I hope this helps!

Code in Python:

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

ab = abs(num)

sqrt = float(ab ** 0.5)

print(sqrt)