this is my code.
def percent_of_goal(donation, goal):
""" percentofgoal
"""
perc = float(goal/donation)
return 100/perc
but when I do print(percent_of_goal(0, 1000))
with 0 as the donation, I get a zero division error? how do I fix this?
error message:
*** RUN TIME ERROR(S) ***
Traceback (most recent call last):
File "source.py", line 8, in <module>
result = percent_of_goal(0, 1000)
File "source.py", line 4, in percent_of_goal
perc = goal/donation
ZeroDivisionError: division by zero