Ad

The script catches a ValueError such that if a user inputs a non-integer it will bring up an error message

def circle ():
    try:
        radius = int(input("Enter the radius of the circle: "))
        pi = 3.14
        area = pi * radius * radius
        return f'The area of the circle is {area}'
    except ValueError:
        return ("Radius can only be a number!")