Search Header Logo

Computer Science LISTS

Authored by Steve Rich

Computers

12th Grade

Used 72+ times

Computer Science LISTS
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Correct code to define a list in Python?

scores = [15, 29, 4, 50]

scores = {15, 29, 4, 50}

Int[] scores = {15, 29, 4, 50};

scores = (15, 29, 4, 50)

2.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Media Image

Choose all the ways in which a Python list is different from an array ...

Arrays have fixed length: Lists have dynamic length

Arrays only contain one data type; Lists can contain many data types

Arrays are indexed from 1; Lists are indexed from 0

Arrays can not be empty; Lists can be empty

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Output is ...?

mango

pear

kiwi

['apple','banana','pear']

4.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Choose three valid methods that may be applied to lists in Python ...

list.append(x)

list.count(x)

list.sort()

list.format()

list.isNumeric()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

colours = ['red', 'blue', 'yellow', 'green', 'purple']


Which instruction illustrates mutability?

colours[2] = 'pink'

colours.append('pink')

colours.insert(2, 'pink')

colours.remove('pink')

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Output is ... ?

Index out of range

29

34

89

7.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Media Image

Correct code to access the second 'Terry' in this list ... ?

montyPython[5]

montyPython[6]

montyPython[-1]

montyPython[3]

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

Already have an account?