Question: Python Question. Can someone help me solve 2 & 3, given question 1. Practice Question 1: Finding a Product Consider the following function that multiplies
Python Question.
Can someone help me solve 2 & 3, given question 1.




Practice Question 1: Finding a Product Consider the following function that multiplies all the numbers in a given list: def prod(1): for i in l: Pi returnP ID: cell-874a0cb020a0a78 Read-only This works quite well, given a list of all integers, or a mix with floating point numbers: 1: prod (1,2,3,7]) -42 1: prod(t1.0, 2.0, 3.1, 17.5]) 108.5 ID: cell-719e1919c336bae Read-only However, adding strings or lists produces unexpected behaviours: prod(t1, 2, 3, 'badger')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
