COMP177 Mod 8 - Lists & Dictionaries

COMP177 Mod 8 - Lists & Dictionaries

University

16 Qs

quiz-placeholder

Similar activities

Machine Learning

Machine Learning

University

20 Qs

Algoritma Pemrograman

Algoritma Pemrograman

University

20 Qs

Digital Technology Office 365 - 29May2020

Digital Technology Office 365 - 29May2020

University - Professional Development

13 Qs

ロジックテスト (Đề kiểm tra năng lực IT)

ロジックテスト (Đề kiểm tra năng lực IT)

University

12 Qs

Information Technology

Information Technology

University

17 Qs

Fotogrametri dan Penginderaan Jauh

Fotogrametri dan Penginderaan Jauh

University

20 Qs

2.3.1 Graph Traversal & Path Finding Algorithms

2.3.1 Graph Traversal & Path Finding Algorithms

12th Grade - University

20 Qs

Quiz Harian Gdevelop MPK

Quiz Harian Gdevelop MPK

University

20 Qs

COMP177 Mod 8 - Lists & Dictionaries

COMP177 Mod 8 - Lists & Dictionaries

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Karen Diggs

Used 12+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the listmy_list = ['1880', '990EZ', 'Tax Forms']. Which statement gives '990EZ' as the output?

print(my_list[:1])

print(my_list[1])

print(my_list[2])

print(my_list[-2])

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output? new_list = [10, 'ABC', '123', 25] my_list = new_list[:] new_list[2] = 16 print(new_list) print(my_list)

[10, 'ABC', 16, 25]

[10, 16, '123', 25]

[10, 16, 123, 25]

[10, 'ABC', '123', 25]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the option that gives 'great' as the output. my_list = ['books', 'are', 'Great', 'for', 'learning'] my_list.sort()

my_list = ['books', 'are', 'Great', 'for', 'learning']

print(my_list.pop(3))

my_list = ['Great', 'books', 'are', 'for', 'learning']

my_list.sort()

print(my_list.pop(1))

my_list = ['books', 'are', 'great', 'for', 'learning']

my_list.sort()

print(my_list.pop(3))

my_list = ['books', 'are', 'for', 'great', 'learning']

my_list.sort()

print(my_list.pop(4))

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following code blocks will give 3 as the output?

my_list = [10, 10, 2, 5, 10] print(my_list.index(10) + my_list.count(10))

my_list = [11, 2, 10, 10, 10] print(my_list.index(10) , my_list.count(10))

my_list = [11, 2, 10, 10, 10] print(my_list.index(10) + my_list.count(10))

my_list = [10, 10, 2, 5, 10] print(my_list.index(10) , my_list.count(10))

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output? new_list = [10, 20, 30, 40, 50] for i in new_list: print(i * 2)

20

40

60

80

100

10 10

20 20

30 30

40 40

50 50

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

[20, 40, 60, 80, 100]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the lists my_list = [['The', 'Magic'], ['Rhonda', 'Byrne']] and new_list = []. Select the option that will produce 'The Magic : Rhonda Byrne' as the output.

for i, j in enumerate(my_list):
    new_list.append(j)
print('{} {}: {} {}'.format(new_list[0], new_list[1], new_list[2], new_list[3]))

for i, j in enumerate(my_list):
    new_list = j
print('{} {}: {} {}'.format(new_list[0], new_list[1], new_list[2], new_list[3]))


for i, j in enumerate(my_list):
    new_list = my_list[i]
print('{} {}: {} {}'.format(new_list[0], new_list[1], new_list[2], new_list[3]))


for i, j in enumerate(my_list):
    for item in my_list[i]:
        new_list.append(item)
print('{} {}: {} {}'.format(new_list[0], new_list[1], new_list[2], new_list[3]))

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is output?

new_list = [['hello', 'word'], 'good morning', 'have a nice day'] print(new_list[0:2])

['hello', 'word']

[['hello', 'word'], 'good morning']

['hello', 'word', 'good morning']

[['hello', 'word'], 'good morning', 'have a nice day']

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?