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!")
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)