Courseiva
Computer Programming and Python FundamentalseasyMultiple ChoiceObjective-mapped

PCEP Computer Programming and Python Fundamentals Practice Question

Exhibit

Refer to the exhibit.

{
  "name": "config",
  "version": 2,
  "settings": {
    "debug": true,
    "port": 8080
  }
}

The exhibit shows a JSON configuration. Which Python data structure is best suited to represent this configuration?

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

Dictionary

JSON objects map directly to Python dictionaries. Option B (Tuple) is wrong because tuples are immutable and lack key-value mapping. Option C (String) is wrong because a string would lose all structure, making access by key impossible. Option D (List) is wrong because lists are ordered sequences accessed by index, not by key-value pairs.

Answer analysis

Option-by-option breakdown

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

  • Dictionary

    Why this is correct

    JSON objects map directly to Python dictionaries.

  • Tuple

    Why it's wrong here

    A tuple is immutable and not suitable for key-value mappings.

  • String

    Why it's wrong here

    A string would lose the structured key-value nature of JSON.

  • List

    Why it's wrong here

    A list would require integer indices instead of string keys.

About these practice questions

One of 498 original PCEP practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.