Skip to content

Instantly share code, notes, and snippets.

@ehedaoo
Created May 2, 2017 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehedaoo/03c6f8000513dba19266fe77b52cc660 to your computer and use it in GitHub Desktop.
Save ehedaoo/03c6f8000513dba19266fe77b52cc660 to your computer and use it in GitHub Desktop.
Write a Python program to multiplies all the items in a list.
# Write a Python program to multiplies all the items in a list.
# a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
def multiply_items(a):
mult = 1
for i in a:
mult = mult*i
return mult
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
print(multiply_items(a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment