Any2Quiz
CBSE / 10 / Computer Science / Programming with Python

Data Types and Variables Quiz - CBSE Class 10 Computer Science

Free practice quiz: Data Types and Variables (CBSE Class 10 Computer Science). 37 multiple-choice questions with answers and explanations. Play online, no sign-up needed.

Play all 37 questions free

Sample questions

  1. What is a variable in Python?

    1. A place to store a value
    2. A data type
    3. A function
    4. An error
    Show answer

    Answer: A. A place to store a value

    A variable is used to store data or values in a program. In Python, a variable can hold different data types.

  2. Which keyword is used to define a variable in Python?

    1. var
    2. let
    3. def
    4. None
    Show answer

    Answer: D. None

    Python does not use a specific keyword to define a variable. A variable is created by assigning a value to it.

  3. What will be the output of: bool([])?

    1. True
    2. False
    3. Error
    4. None
    Show answer

    Answer: B. False

    In Python, empty collections (like empty lists) evaluate to False when converted to a boolean.

  4. Which of the following statements is true about string data type in Python?

    1. Strings are mutable.
    2. Strings can store numerical values only.
    3. Strings are immutable.
    4. Strings can only use single quotes.
    Show answer

    Answer: C. Strings are immutable.

    In Python, strings are immutable, meaning that once created, their content cannot be changed.

  5. How are negative indexes used in Python lists?

    1. To access elements in reverse order
    2. To throw an error
    3. To declare null values
    4. To replace elements
    Show answer

    Answer: A. To access elements in reverse order

    Negative indexes in Python lists start counting from the end of the list, allowing reverse accessing of elements.

Take the full quiz

More quizzes

Browse all Programming with Python quizzes