Question

Write a function calc_bonus (sales) which calculates and returns the bonus value given a sales amount based on the following criteria:

Sales >= 100000 [80000- 100000) [50000-80000) <50000 Bonus 5000 3500 1000 O

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def calc_bonus(sales):
    # Checking if sales is greater than or equals to 100000
    if(sales>=100000):
        # Returning value 5000 as bonus
        return 5000
    # Checking if sales is greater than or equals to 80000
    elif(sales>=80000):
        # Returning value 3500 as bonus
        return 3500
    # Checking if sales is greater than or equals to 50000
    elif(sales>=50000):
        # Returning value 1000 as bonus
        return 1000
    # Checking if sales is less than 50000
    else:
        # Returning value 0 as bonus
        return 0

# Testing
print(calc_bonus(85000))

Output

3500

Note Please comment below if you have any doubtsPlease up vote the solution if it helped. Thanks

Add a comment
Know the answer?
Add Answer to:
Write a function calc_bonus (sales) which calculates and returns the bonus value given a sales amount...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT