โ† All Online Coding Lessons Flashcard Decks

Python Coding Basics Flashcards

6 cards from real Online Coding Lessons practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Python Coding Basics flashcards as text
  1. How do you import a module in Python?

    Answer: import math

    Python uses the 'import' keyword to bring in modules that provide additional functionality.

  2. What does the 'range(5)' function return in Python?

    Answer: [0, 1, 2, 3, 4]

    range(5) generates a sequence starting from 0 up to but not including 5, producing 0, 1, 2, 3, 4.

  3. Which method is used to add an item to the end of a Python list?

    Answer: .append()

    The .append() method adds a single item to the end of a Python list.

  4. What is a Python dictionary?

    Answer: A collection of key-value pairs

    A Python dictionary is a collection of key-value pairs where each unique key maps to a value.

  5. What is the Boolean value of an empty string in Python?

    Answer: False

    An empty string '' is considered 'falsy' in Python and evaluates to False in a Boolean context.

  6. What does the 'pass' statement do in Python?

    Answer: Does nothing and acts as a placeholder

    The 'pass' statement is a null operation used as a placeholder where code is syntactically required but no action is needed.

Python Coding Basics Flashcards โ€” Online Coding Lessons Study Cards with Answers