The promoter wants to be able to classify donors based on how much they have contributed to the overall goal of the campaign.
Write a function easy_donor_rank(percent_donated) that takes a number indicating percent donated and returns a string containing the rank attained by giving such a donation.
For example, the function call easy_donor_rank(1.0) should return the string 'Bronze'.
See the table below to see the list of donor ranks.
Donor Classification
- Donation Percentage Donor Rank
- 0% or less
- Error Less than 2% Bronze
- 2% to 15% inclusive Silver more than 15% Gold
The code I have right now works but I always get a "None" in the end of every output
def easy_donor_rank(percent_donated):
if percent_donated <= 0:
print("Error")
if percent_donated < 2:
print("Bronze")
elif percent_donated >= 2 and percent_donated <= 15:
print("Silver")
else:
print("Gold")