
SAQ 4.1
Authored by Parker Gaston
Other
University

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
17 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Using a for loop, we can iterate through the items of a Python list in either a "by item" or a "by index" manner.
True
False
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
This function is supposed to sum all of the elements in a list of numbers. Which of the following should replace the comment line?
def sumList(myList):
acc = 0
# what goes here?
acc = acc + myList[i]
return acc
for i in range(len(myList)):
for acc in myList:
for myList:
for x in myList:
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assuming the parameter myList is a list of integers between zero and 100, what does this function return?
def foo(myList):
x = -1
for y in myList:
if y > x:
x = y
return x
The second largest value in myList
The smallest value in myList
The second smallest value in myList
The largest value in myList
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this code?
myList = [-1, 4, 5, -3, 8, 4, 1, 0, -3, 0]
acc = 0
for i in myList:
if i > 0:
acc = acc + i
acc
-7
22
7
45
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is output by the following code?
changeList = [1, 2, "buckle my shoe", 3, 4, "shut the door"]
changeList[2] = "the sky is blue"
changeList
'the sky is blue'
[1, 'the sky is blue', "buckle my shoe", 3, 4, 'shut the door']
TypeError:object does not support item assignment
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Python provides the _________ function to create a list from a range or string.
list
append
insert
[ ]
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The __________ list method removes and returns the last item in a list.
reverse
count
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
12 questions
National Day Quiz
Quiz
•
University
13 questions
football of world
Quiz
•
1st Grade - University
13 questions
Anime 99
Quiz
•
9th Grade - Professio...
15 questions
U. Hadist tugas 1
Quiz
•
University
20 questions
Principal of marketing chapter 2
Quiz
•
University
20 questions
Songs & Song Artists
Quiz
•
3rd Grade - Professio...
13 questions
Five Nights At Freddy's: Security Breach Quiz
Quiz
•
KG - Professional Dev...
15 questions
Overview of E-Banking
Quiz
•
University
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Other
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
5 questions
What is Presidents' Day?
Interactive video
•
10th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
20 questions
Mardi Gras History
Quiz
•
6th Grade - University
10 questions
The Roaring 20's Crash Course US History
Interactive video
•
11th Grade - University
17 questions
Review9_TEACHER
Quiz
•
University