Courseiva

PCEP Practice Question: Functions, Tuples, Dictionaries and Exceptions

Match each Python function to its description.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Outputs objects to the console

Reads a string from standard input

Returns the number of items in a container

Returns the type of an object

Converts a value to an integer

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

len: Returns the number of items in an object

These are common built-in Python functions. len() returns length, print() outputs, int() converts to integer, str() converts to string, and input() reads user input.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • len: Returns the number of items in an object

    Why this is correct

    The len() function returns the length (number of items) of an object like a list, string, etc.

  • print: Outputs data to the standard output

    Why this is correct

    The print() function writes data to the console.

  • int: Converts a value to an integer

    Why this is correct

    The int() function converts a number or string to an integer type.

  • str: Returns the length of a string

    Why it's wrong here

    Incorrect — the length of a string is returned by len(), not str(). str() converts an object to a string.

  • input: Outputs data to the console

    Why it's wrong here

    Incorrect — input() reads a line from user input; it does not output data (print() does).

About these practice questions

This PCEP question is part of Courseiva's 498-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCEP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCEP exam.