← All PCAP Flashcard Decks

Functions and Modules 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 Functions and Modules flashcards as text
  1. What does the `*args` parameter in a function definition allow?

    Answer: A variable number of positional arguments

    `*args` collects extra positional arguments into a tuple inside the function.

  2. What does `**kwargs` allow in a function definition?

    Answer: Variable keyword arguments as a dictionary

    `**kwargs` collects extra keyword arguments into a dictionary inside the function.

  3. What is a lambda function in Python?

    Answer: An anonymous single-expression function

    A lambda is an anonymous function defined with the `lambda` keyword that contains a single expression.

  4. What does the `return` statement do in a function?

    Answer: Exits the function and optionally passes a value back

    `return` ends function execution and sends a value back to the caller.

  5. Which built-in function applies a function to every item in an iterable?

    Answer: map()

    `map()` applies a function to each element of an iterable and returns a map object.

  6. How do you import only the `sqrt` function from the `math` module?

    Answer: from math import sqrt

    The `from module import name` syntax imports a specific name from a module.

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, exam format, passing score, retake fee, retake policy, score release, time limit, score validity, exam information · verified Oct 2026
  2. home.pearsonvue.com — Test delivery · verified Oct 2026