Recap - Product List
Part of the Fundamentals section of Coddy's Python journey — lesson 57 of 77.
Challenge
EasyWrite a function named prod which gets a list of numbers as argument and returns the product of all the numbers in the list.
Reminder, product is the multiplication of all the numbers, for [1, 2, 3], return 6 = 1 * 2 * 3.
Try it yourself
def prod(lst):
# Write code hereAll lessons in Fundamentals
4Operators Part 2
Logical Operators Part 1Logical Operators Part 2Recap - Simple LogicLogical Operators Part 3Logical Operators Part 48Loops
For LoopWhile LoopBreakContinueRecap - FactorialThe Range FunctionNested LoopRecap - Dynamic Input11Lists Basics
Declaring a ListAccessing List ElementsModifying ListsList MethodsRecap - Product ListRecap - Reversed ListTuple3Operators Part 1
Arithmetic OperatorsModulo OperatorArithmetic ShortcutsRecap - Simple MathComparison Operators9Functions
Declare a FunctionArgumentsReturnRecap - Sigma FunctionRecap - Validation FunctionDefault Values12Iterating Over Sequences
Iterating Over ElementsThe Enumerate FunctionIterating Over Strings Part 1Iterating Over Strings Part 2