diff --git a/scripts/1002.py b/scripts/1002.py index 709b5b3..7008435 100644 --- a/scripts/1002.py +++ b/scripts/1002.py @@ -1,3 +1,8 @@ -r = float(input()) -a = (r * r) * 3.14159 -print("A=%0.4f" %a) +while True: + try: + r = float(input("Give me any radius and I will calculate the circle's area: ")) + a = (r * r) * 3.14159 + print("A=%0.4f" % a) + break # Exit the loop if the input is valid + except: + print("Please enter an actual number.")