id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

burns@bxscience.edu > discount
prev  |  next  |  chance

If person is a preferred customer they get a 10% discount on their order, if not they get a 5% discount. The variable preferred is a boolean variable, order is the amount before discount. Complete the function which will return the amount of their discounted order.


discount(True, 100) → 90.0
discount(False, 100) → 95.0
discount(True, 200) → 180.0

...Save, Compile, Run (ctrl-enter)

def discount(preferred, order):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100

Copyright Nick Parlante 2017 - privacy