
Mini Quiz II Review Exercises

Quiz
•
Education
•
University
•
Easy
Kyriaki Mengoudi
Used 3+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the statements below are reasons we might iterate over a list by position, rather than by value? Select all that apply.
To modify the values in a list.
We never need to iterate by position.
To make sure we don’t modify the values in a list.
To iterate over two related lists at the same time
2.
OPEN ENDED QUESTION
3 mins • 1 pt
What does the variable new_list contain after the following code runs?
values = [2, 4, 6, 8, 10, 12] new_list = [] for num in values[:3]: new_list.append(num * 2)
Evaluate responses using AI:
OFF
3.
OPEN ENDED QUESTION
3 mins • 1 pt
What does the variable numbers contain after the following code runs? numbers = [5, 15, 25, 35, 45] for i in range(1, len(numbers)): numbers[i] = numbers[i] + numbers[i - 1]
Evaluate responses using AI:
OFF
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following Python snippets is best for calling a function named foo that takes no parameters and returns an int? Select only one option (the best answer) below.
foo = ()
foo()
foo = def()
result = foo()
5.
OPEN ENDED QUESTION
3 mins • 1 pt
What will the following Python code print? def func(p1): x = p1 * 2 return x def main(): x = 4 func(x) print(x * 2) print(func(x * 2)) main()
Evaluate responses using AI:
OFF
6.
OPEN ENDED QUESTION
3 mins • 1 pt
What will the following Python code print? def big_vals(lst, k): new_lst = [] for num in lst: if num > k: new_lst.append(num) return new_lst def main(): results = big_vals([1, 2, 3, 4, 5], 3) print(results) main()
Evaluate responses using AI:
OFF
7.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
For the 2D list lst = [[2, 4, 6, 8], [1, 2, 3, 4]], circle all the expressions below that produce no error and access a one-dimensional list.
lst
lst[0]
lst[1]
lst[1][1]
lst[2]
8.
OPEN ENDED QUESTION
3 mins • 1 pt
What would the code below print to the terminal? lst = [[2, 4, 6, 8], [1, 2, 3, 4]] for i in range(len(lst)): print(lst[i][1])
Evaluate responses using AI:
OFF
9.
OPEN ENDED QUESTION
3 mins • 1 pt
What would the code below print to the terminal? def count_string(names, s): count = 0 for i in range(len(names)): for j in range(len(names[i])): if names[i][j] == s: count += 1 return count def main(): lst = [["carol", "grizz"], ["carol", "choux"]] name = "carol" print(count_string(lst, name)) main()
Evaluate responses using AI:
OFF
Similar Resources on Wayground
10 questions
List Quiz

Quiz
•
University
7 questions
for while

Quiz
•
University
9 questions
PWD_TP1_TP2_TP3

Quiz
•
University
5 questions
Advantages and disadvantages of using media

Quiz
•
University
10 questions
Quiz Media Digital untuk Pembelajaran

Quiz
•
University
5 questions
[Yes or No] Grey Literature

Quiz
•
University
10 questions
quize

Quiz
•
University
10 questions
Paradigma

Quiz
•
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 Education
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