COMP177 Mod 8 - Lists & Dictionaries

Quiz
•
Computers
•
University
•
Hard
Karen Diggs
Used 12+ times
FREE Resource
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
Similar Resources on Wayground
14 questions
Java Operators

Quiz
•
University
20 questions
Python Functions and File Operations Quiz

Quiz
•
University
15 questions
Python

Quiz
•
6th Grade - University
20 questions
Week 6 Quiz

Quiz
•
University
21 questions
COMP1010 Week 4 Quiz - Edit to streamline!

Quiz
•
University
11 questions
Array

Quiz
•
University
20 questions
kuis pertama

Quiz
•
University
19 questions
Computer Science Quiz 02

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University