На вход поступает строка. Вам необходимо преобразовать его в числовой формат. Пожалуйста, отметьте Как мне разобрать строку в число с плавающей точкой или int?
Кроме того, при сравнении вы должны вызывать функцию с параметрами. Я не проверял математику, но думаю, это то, что вы ищете:
y1 = float(input(print("What is the y coordinate of the first circle: ")))
r1 = float(input(print("What is the radius of the first circle: " )))
x2 = float(input(print("What is the x coordinate of the second circle: ")))
y2 = float(input(print("What is the y coordinate of the second circle: ")))
r2 = float(input(print("What is the radius of the second circle: ")))
import math
def distance(x1, y1, x2, y2):
return math.sqrt(math.pow(x2 - x1, 2) +
math.pow(y2 - y1, 2) * 1.0)
print("%.6f"%distance(x1, y1, x2, y2))
if distance(x1, y1, x2, y2) <= abs(r1 - r2):
print("Circle 2 is inside of circle 1")
elif distance(x1, y1, x2, y2) <= (r1 + r2):
print("Circle 2 overlaps circle 1")
else:
print("Circle 2 does not overlap circle 1")