Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 6 - Functions - Section 6.5 - Positional and Keyword Arguments - Check Point - MyProgrammingLab - Page 180: 6.12

Answer

f(1, p2 = 3, p3 = 4, p4 = 4) - Correct f(1, p2 = 3, 4, p4 = 4) - Incorrect f(p1 = 1, p2 = 3, 4, p4 = 4) - Incorrect f(p1 = 1, p2 = 3, p3 = 4, p4 = 4) - Correct f(p4 = 1, p2 = 3, p3 = 4, p1 = 4) - Correct

Work Step by Step

1st, 4th and 5th function calls are correct as they have correct number of arguments and all positional arguments appear before keyword argument. Also the order of keyword argument does not matter. In 2nd function call positional argument is placed after keyword argument for p3, hence it is incorrect. In 3rd function also positional argument is placed after keyword arguments for p3, hence it is incorrect.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.