2018年1月8日 星期一

Python: Python program to solve (x + y) * (x + y)

Python: Python program to solve (x + y) * (x + y)

Python Basic: Exercise-38 with Solution

Write a Python program to solve (x + y) * (x + y).
Sample Solution:-
x, y = 4, 3
result = x * x + 2 * x * y + y * y
print("({} + {}) ^ 2) = {}".format(x, y, result))

========= RESTART: F:/Python_APSC/py-ex-basic-38.py =========
(4 + 3) ^ 2) = 49
>>> 

沒有留言:

張貼留言

Python Modbus 控制 ADAM-6050 18-ch Isolated Digital I/O Module

Python Modbus 控制  ADAM-6050 18-ch Isolated Digital I/O Module import tkinter as tk from tkinter import messagebox from pymodbus.client impor...