Computers

12th

grade

Image

LIST

2
plays

25 questions

Show Answers
See Preview
  • 1. Multiple Choice
    30 seconds
    1 pt

    What is the output of the following:

    aList = [1, 2, 3, 4, 5, 6, 7]

    pow2 = [2 * x for x in aList]

    print(pow2)

    [2, 4, 8, 16, 32, 64, 128]

    [2, 4, 6, 8, 10, 12, 14]

    [2, 4, 6, 8, 16, 32, 64, 128]

    [2,4,6,8,12,14]

  • 2. Multiple Choice
    30 seconds
    1 pt

    What is the output of the following code:

    list1 = ['xyz', 'zara', 'PYnative']

    print (max(list1))

    xyz

    PYnative

    zara

    native

  • 3. Multiple Choice
    30 seconds
    1 pt

    What is the output of the following list operation:

    sampleList = [10, 20, 30, 40, 50]

    print(sampleList[-2])

    print(sampleList[-4:-1])

    IndexError: list index out of range

    [20, 30, 40]

    40

    40

    [20, 30, 40]

  • Answer choices
    Tags
    Answer choices
    Tags

    Explore all questions with a free account

    Already have an account?