Here is the code :
PI = 3.14
radius = float(input('Please Enter the Radius of a Sphere: '))
sa = 4 * PI * radius * radius
Volume = (4 / 3) * PI * radius ** 3
print("\n The Surface area of a Sphere = %.2f" %sa)
print("\n The Volume of a Sphere = %.2f" %Volume)
Its says above please enter the radius of a sphere
. How could I make it not error code if I enter a string because when I do it says this :
Traceback (most recent call last):
File "D:/Gary/Test2/Euan_4.py", line 2, in <module>
radius = float(input('Please Enter the Radius of a Sphere: '))
ValueError: could not convert string to float: 'rtt'
How could this be fixed.