def z (a,b,c):
a1 = (a + b) ** 2 / (a * b)
a2 = 3.5 if c > 10 else (a - b) ** 2
return (a1 + a2) + max(a1,a2) / 2
print(z(87,56,15))
print(z(87,56,8))
9.795874384236454 def Square(k):
return round(k ** .5) ** 2 == k
print(Square(25))
print(Square(17))
print(Square(81))
print(Square(12))
print(Square(4))
Либо так def Square(k):
return not bool(k ** .5 % 1)
True def f(x,n,y):
return str(y).count(str(x)) == n
s = 0
for i in range(100,1000):
if f(3,2,i):
s += i
print(s)
И так далее. Дальше лень