Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . 3 . 5 : Keyword arguments and default parameters. Refer to the following function definition: def splitCheck ( amount = 1 0 ,

2.3.5: Keyword arguments and default parameters.
Refer to the following function definition:
def splitCheck(amount=10,
numPeople=2,
taxPercentage=0.095,
tipPercentage=0.18):
When entering answers, use the same number of significant digits as the default parameter values in the splitCheck() definition. Answer ERROR if an error occurs.
1)
What value is passed as the taxPercentage argument in the function call splitCheck(60.52,5,0.075, tipPercentage=0.18)?
0.075
Check
Show answer
Correct
0.075
The first three arguments are positional arguments and are mapped to parameters according to position in the argument list.
2)
What value is passed as the numPeople argument in the function call splitCheck(taxPercentage=0.07,60.52,2, tipPercentage=0.18)?
61
Check
Show answer
Incorrect
All keyword arguments must come after every positional argument.
3)
What will the parameter taxPercentage be assigned for the following call? splitCheck(amount=49.50, numPeople=3)
Check
Show answer
4)
Write a statement that splits a $50 check among four people. Use the default tax percentage and tip amount.
Check
Show answer
5)
Write a statement that splits a $25 check among three people and leaves a 25% tip. Use the default tax rate.
Check
Show answer

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions