Python List multiply of all the items in a list














































Python List multiply of all the items in a list



Below is the sample code to find out the multiply of all the items into the list.

This code is tested on python 3.6.

Program:
def multiply_of_list_item(_list):
    multiply_of_item = 1
    for item in _list:
        multiply_of_item *= item
    return multiply_of_item

def main():
    print(multiply_of_list_item([1, 2, 8, 12, 15]))

if __name__ == '__main__':
    main()

Output:
2880





Comments