← All PCEP Flashcard Decks

Type Conversion and Built-in Functions Flashcards

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

Read the first 7 Type Conversion and Built-in Functions flashcards as text
  1. What is the return value of len("Python")?

    Answer: 6

    len() counts characters in the string; "Python" has exactly 6 characters: P, y, t, h, o, n.

  2. What sequence does range(1, 6) generate in Python?

    Answer: Values 1, 2, 3, 4, 5 (stop exclusive)

    range(start, stop) generates values from start up to but not including stop, so range(1, 6) produces 1, 2, 3, 4, 5.

  3. What does abs(-15) return in Python?

    Answer: 15

    abs() returns the absolute value of its argument, converting -15 to 15.

  4. What is the result of max(3, 7, 2, 9, 4)?

    Answer: 9

    max() compares all provided arguments and returns the largest, which is 9.

  5. What does min([10, 3, 7, 1, 5]) return?

    Answer: 1

    min() returns the smallest element in the iterable, which is 1 in this list.

  6. What does round(3.567, 1) return in Python?

    Answer: 3.6

    round(3.567, 1) rounds to 1 decimal place; since the second decimal is 6 (≥5), it rounds up to 3.6.

  7. What is the result of sum([1, 2, 3, 4, 5])?

    Answer: 15

    sum() adds all elements in the iterable; 1+2+3+4+5 equals 15.