65.1k views
3 votes
Input a number and find the square root only if the number entered is greater than or equal to zero.

1 Answer

3 votes

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

if number >= 0:

print(number**0.5)

I hope this helps!

User Anton Rusak
by
5.9k points