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

 

spragunr@jmu.edu > tree_price
prev  |  next  |  chance

The price of trees is based on height. If a tree is 50cm or less, it costs 10 dollars. If the height is between 51cm and 100cm inclusive, the cost is 20 dollars. If the height is 101cm or greater the cost is 30 dollars. Unless it is your birthday -- on that day, all trees are discounted by 3 dollars.


tree_price(40, False) → 10
tree_price(90, True) → 17
tree_price(200, False) → 30

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

def tree_price(height, is_birthday):

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

Copyright Nick Parlante 2017 - privacy