PCEP • Practice Test 9
Free PCEP practice test — 10 questions with explanations. Set 9. No signup required.
A junior developer wrote a function that calculates the average of a list of numbers. Inside the function, they used a variable named 'list' to store the input parameter. Later, they tried to call the built-in list() function to convert a string to a list inside the same function, but it raised a TypeError. The error occurs because the name 'list' now refers to the parameter, not the built-in. The function must be fixed without changing its external behavior. Which solution is the best practice?
Choose an answer to begin — your selection is scored in the full session.
10 questions · instant feedback and full explanations after every question.