Computers

9th -

University

Image

Python- Creating and Altering Data Structures Quiz

199
plays

10 questions

Show Answers
See Preview
  • 1. Multiple Choice
    3 minutes
    1 pt

    Which of the following data structures is immutable?

    Tuple

    List

    Dictionary

    2d List

  • 2. Multiple Choice
    3 minutes
    1 pt

    What does this program print?

    heights = [65, 56, 67, 48, 64]

    heights.sort()

    heights.extend([60, 61, 62])

    heights.remove(67)

    print(heights)

    [48, 56, 64, 65, [60, 61, 62]]

    [48, 56, 60, 61, 62, 64, 65]

    [48, 56, 64, 65, 60, 61, 62]

    The program will error.

  • 3. Multiple Choice
    3 minutes
    1 pt

    How many times does this program print That's a large class!?

    num_students = [23, 21, 33, 35, 24, 35]


    for num in num_students:

    if num > 23:

    print("That's a large class!")

    0

    1

    4

    6

  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?