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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 37 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply