Skip to content

Commit aa08ee7

Browse files
Create ProductOfSumAndDifference.py
You are given two integers, a and b. Compute the Sum and Difference of a and b. Return the Product of Sum and Difference. Input Format First Parameter - Integer a Second Parameter - Integer b Output Format Return the integer. Example 1: Input: 5 2 Output: 21 Explanation: Sum is (5 + 2) = 7 and Difference is (5 - 2) = 3. The product of Sum and Difference is 21.
1 parent f3dabfe commit aa08ee7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ProductOfSumAndDifference.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def solve(a, b):
2+
return (a+b)*(a-b)
3+
4+
if __name__ == '__main__':
5+
a = int(input())
6+
b = int(input())
7+
res = solve(a, b)
8+
print(res)

0 commit comments

Comments
 (0)