Link to the project https://onlinegdb.com/2--AfMAmvT

0 votes

Here's an example of how to do it.

I also used math.pi to have higher accuracy and used a new variable for the area not to confuse anyone as for you, the variable rad is not containing the radius anymore, but the area in the end.

import math print("Welcome to Area of a Circle Calculator. Please enter the Radius of the circle. Enter an invalid radius (less than 0) to quit.") rad = float(input("r = ")) while (rad >= 0): area = rad *rad * math.pi print(f"The area of the circle is {area}.") rad = float(input("r = "))

...