← All PCAP Flashcard Decks

Standard Library and Built-ins Flashcards

6 cards from real PCAP practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 Standard Library and Built-ins flashcards as text
  1. What does `json.dumps({'key': 'value'})` return?

    Answer: A JSON-formatted string

    `json.dumps()` serializes a Python object to a JSON-formatted string (`dumps` = dump to string).

  2. Which `json` function parses a JSON string into a Python object?

    Answer: json.loads()

    `json.loads()` deserializes a JSON string into a Python object (`loads` = load from string).

  3. What does `os.listdir('.')` return?

    Answer: A list of file and directory names in the current directory

    `os.listdir(path)` returns a list of all entries (files and directories) in the specified directory.

  4. What does `abs(-5)` return?

    Answer: 5

    `abs()` returns the absolute value of a number, which is always non-negative.

  5. Which built-in function returns the larger of two values?

    Answer: max()

    `max()` returns the largest item in an iterable or the largest of two or more arguments.

  6. What does the `copy` module's `deepcopy()` function do?

    Answer: Recursively copies an object and all objects it references

    `deepcopy()` creates a completely independent copy of an object, recursively copying all nested objects.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. pythoninstitute.org — Eligibility, fees, retake fee, retake policy, score release, time limit, score validity · verified Nov 2026
  2. home.pearsonvue.com — Test delivery · verified Nov 2026