A = int(input("a = "))
b = int(input("b = "))
a2 = a*a
b2 = b*b
print('%d^2 + %d^2 = %d' % (a,b,a2+b2))
print('%d^2 - %d^2 = %d' % (a,b,a2-b2))
print('%d^2 * %d^2 = %d' % (a,b,a2*b2))
print('%d^2 / %d^2 = %f' % (a,b,a2/b2))
Пример:
a = 15
b = 27
15^2 + 27^2 = 954
15^2 - 27^2 = -504
15^2 * 27^2 = 164025
15^2 / 27^2 = 0.308642