← 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. Which module is used to work with regular expressions in Python?

    Answer: re

    The `re` module provides regular expression matching operations.

  2. What does `re.match()` do differently from `re.search()`?

    Answer: match() only matches at the beginning of the string

    `re.match()` only looks at the beginning of the string, while `re.search()` scans the entire string.

  3. What does `sys.argv` contain?

    Answer: Command-line arguments as a list

    `sys.argv` is a list where `sys.argv[0]` is the script name and the rest are command-line arguments.

  4. Which built-in function converts a string to an integer?

    Answer: int()

    `int()` converts a string or number to an integer, raising `ValueError` for invalid input.

  5. What does `dir(obj)` return?

    Answer: A list of valid attributes and methods of the object

    `dir()` returns an alphabetically sorted list of names in the current scope or object's attributes.

  6. Which module provides `namedtuple` for creating tuple subclasses with named fields?

    Answer: collections

    `collections.namedtuple` creates tuple subclasses with named fields for readable attribute access.

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