top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Multiplying all elements in list

Writer's picture: Rawda RumaiehRawda Rumaieh

since “A Journey of a Thousand Miles Begins with a Single Step”

understanding how to basically reach every element in a list and using it can be a salient step in many applications.

it is not about how simple a task is .. it is all about how can I use this task to build a masterpiece out of it.


here in my simple application I take a list and multiply every element of it then return the result


here is the code snippet

#defining a function that takes a list 
def multiply_all (my_list):
#defining the result as 1 so it gets multiplied by the first element
     product=1
 #looping over my list
    for i in my_list:
#multiplying the product with the current element in the list
   product=product*i
#returning the product
    return product
0 comments

Recent Posts

See All

Comments


COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page