mijee7499 mijee7499
  • 21-10-2020
  • Computers and Technology
contestada

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.

Respuesta :

akasa899
akasa899 akasa899
  • 21-10-2020

Answer:

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

ab = abs(num)

sqrt = float(ab ** 0.5)

print(sqrt)

Explanation:

Answer Link

Otras preguntas

Which of these was the basic idea of the New Deal? A) the Supreme Court is responsible to the executive branch B) Energy production should be solely the conc
5.567 round hundredths
What is 26% as a fraction in simplest form? A. 26⁄10 B. 13⁄50 C. 6⁄25 D. 26⁄100
Why are the colonists sick and weak?
What is unit form for 4 tens + 6 tens
Ming-Li spent $15 at the movies. She then earned $30 babysitting. She spent $12 at the bookstore. She now has $18 left. How much money did Ming-Li have to begin
What are the perfect cubes from 100-600
How long will it take you to drive 135 miles at a speed of 45 miles per hour?
how does a plane and parachute manipulate air resistance differently?
Of these five states, which were free states? Kansas, Iowa, Illinois, Tennessee, Missouri