Question: Please write code in python Part 1 Dessert Time AGAIN will order dessert Write a function will_order_dessert that takes in two parameters: kind (a string),

Please write code in python

Please write code in python Part 1 Dessert Time AGAIN will orderdessert Write a function will_order_dessert that takes in two parameters: kind (astring), price (a number, assumed to be in dollars) in that orderand returns True for any of these conditions (otherwise return false): thekind of dessert is "Ice Cream" the kind of dessert is "PumpkinPie" the price is less than or equal to 3 dollars Conditions:

Part 1 Dessert Time AGAIN will order dessert Write a function will_order_dessert that takes in two parameters: kind (a string), price (a number, assumed to be in dollars) in that order and returns True for any of these conditions (otherwise return false): the kind of dessert is "Ice Cream" the kind of dessert is "Pumpkin Pie" the price is less than or equal to 3 dollars Conditions: you cannot use the keywords: and, or, not either parameter can be None for price, treat None as being 0 for kind, treat None as the empty string (an empty string has no characters) print(will_order_dessert (None, None)) # ==> True print(will_order_dessert("Ice Cream", None)) # ==> True print(will_order_dessert (None, 3.85)) # ==> False will order dessert (again) Write a function will_order_dessert_again with the same signature as will_order_dessert. A function signature means its inputs and outputs. Two functions have the same signature if their input types and order are the same and their output types are the same. This function returns True ONLY if the following conditions hold: the kind of dessert is "Ice Cream" and the price is less than 5 dollars Conditions: you cannot use the keywords: and, or, not either parameter can be None for price, treat None as being 0 for kind, treat None as the empty string (an empty string has no characters) Hints (for just desserts): Try to break up your logic into separate parts and assign default values instead of writing guarded if statements. Part 2: Tax Season Create two functions: calculate_simple_rate and calculate_tax_rate Both functions have two parameters (age and income). Both will return a number representing the tax rate based on the two parameters. You can assume the parameters will only be numbers (no need to worry about None) You ARE allowed to use the boolean operators not, and, or. calculate_simple_rate Finish the implementation for the function calculate_simple_rate anyone under 16 is taxed 5% (0.05) anyone 65 or over is taxed 2% everyone else is taxed based on income less than $10,000, tax rate is 10% $10,000 or more but less than $50,000, tax rate is 15% $50,000 or more but less than $100,000 tax rate is 20% $100,000 and over is taxed at 25% def calculate_simple_rate(age, income): tax_rate = 0 # your logic # this is the only place a return should happen return tax rate calculate_tax_rate Finish the implementation calculate_tax_rate which returns a number based on the following rules: anyone under 16 is taxed 5% anyone between the ages of 16 and 19 (inclusive) is taxed at 10% anyone making 100,000 or more is taxed an additional 3% regardless of age anyone over 19 is taxed based on income: less than 10,000: 15% between 10,000 and 20,000: 20% [inclusive) over 20,000: 25% So a 15 yr old making $120,000 would be taxed 8% (5% + 3%). def calculate_tax_rate(age, income) : tax_rate = 0 # your logic # this is the only place a return should happen return tax rate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!