โ† All PCEP Flashcard Decks

Fundamentals of Python Programming 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 Fundamentals of Python Programming flashcards as text
  1. What is the output of `print(type(3.0))` in Python?

    Answer:

    3.0 is a floating-point literal, so its type is `float`.

  2. Which operator is used for integer (floor) division in Python?

    Answer: //

    The `//` operator performs floor division, discarding the fractional part.

  3. What value does `bool('')` return?

    Answer: False

    An empty string is falsy in Python, so `bool('')` returns `False`.

  4. What is the result of `10 % 3` in Python?

    Answer: 1

    The modulo operator `%` returns the remainder of 10 divided by 3, which is 1.

  5. Which of the following is a valid Python identifier?

    Answer: _count

    `_count` is valid because identifiers can start with an underscore, but not a digit or hyphen, and cannot be reserved keywords.

  6. What does the `len()` function return when called on the string `'hello'`?

    Answer: 5

    `len('hello')` returns 5 because there are five characters in the string.

  7. In Python, what is the result of `'3' + '4'`?

    Answer: 34

    String concatenation with `+` joins the two string literals, resulting in `'34'`.