Skip to content

Commit

Permalink
Added function dividing elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mambelli committed Jun 4, 2024
1 parent a48f93d commit 53b07cd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/planetsmath/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ def multiply_by_2(list):


def division_function(list):
"""
A function that takes a list and returns 1/the product of the elements
Args:
list(list): list of numbers
Return:
float: 1/the product
"""
division = 1.0
for item in list:
division /= item
Expand Down

0 comments on commit 53b07cd

Please sign in to comment.