Page 1 of 1

Write a function product or sum(num1, num2) that takes two int parameters and returns either their sum or their product,

Posted: Thu May 05, 2022 12:43 pm
by answerhappygod
Write A Function Product Or Sum Num1 Num2 That Takes Two Int Parameters And Returns Either Their Sum Or Their Product 1
Write A Function Product Or Sum Num1 Num2 That Takes Two Int Parameters And Returns Either Their Sum Or Their Product 1 (15 KiB) Viewed 38 times
Write a function product or sum(num1, num2) that takes two int parameters and returns either their sum or their product, whichever is larger. In the first example below, the sum (17. 1) is greater than the product (171), so the sum is returned. In the second example, the product (211) is greater than the sum (2+11), so the product is returned For example: Test Result print (product_or_sum(17, 1)) 18 print (product or sum(2, 11)) 22