Write a Python program to solve (x + y) * (x + y)


Introduction

Write a Python program to solve (x + y) * (x + y). I have used python 3.7 compiler for debugging purpose.


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. x, y = 5, 4
  2. result = x * x + 2 * x * y + y * y
  3. print("({} + {}) ^ 2) = {}".format(x, y, result))

Result

python language techstudy.org

     





Related Topics




Popular Posts