Consider the following code segment:
myList ← ["red", "yellow", "green", "blue"]
X ← <MISSING CODE>
DISPLAY(X)
What should <MISSING CODE> be replaced with so that “yellow” is displayed after executing the code?
Unit 2: Abstraction, Algorithms, List
Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Stephannia Kabanakis
Used 12+ times
FREE Resource
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
myList ← ["red", "yellow", "green", "blue"]
X ← <MISSING CODE>
DISPLAY(X)
What should <MISSING CODE> be replaced with so that “yellow” is displayed after executing the code?
[2]myList
myList[2]
myList[“yellow”]
“yellow”[myList]
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
numberList ← [2, 5, 8, 1]
X ← numberList[1] + numberList[3]
DISPLAY(X)
What will be displayed after executing the code segment?
10
7
13
3
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
words ← [“hello”, “bye”, “no”, “yes”]
Which of the following is a valid index for the list, words?
5
-1
"bye"
4
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A programmer is writing a sports program that handles football teams and their players. Which of the following is the most appropriate data type to represent a collection of different football player’s names?
String
Boolean
Numeric
List
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
firstList ← ["apple", "banana", "orange"]
secondList ← ["grape", "lemon"]
thirdList ← []
thirdList ← firstList
firstList ← secondList
secondList ← thirdList
What are the contents of secondList after the code segment is executed?
[ ]
["apple", "banana", "orange"]
["grape", "lemon"]
["apple", "banana", "orange", "grape", "lemon"]
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment:
numbersList ← [8, 6, 2, 1]
APPEND ( numbersList , 4 )
X ← numbersList[1]
Y ← numbersList[5]
Z ← X MOD Y
DISPLAY (Z)
What displays after the code segment is executed?
4
0
3
1
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a benefit of using a list as a data abstraction in a program?
Lists often allow their size to be easily updated to hold as many data values as needed.
Lists convert all elements to strings so that they can be inspected character-by-character.
Lists prevent duplicate data values from appearing in the list.
Lists are used to store all input data so that there is a running record of all user input.
15 questions
UIUX Chap 3
Quiz
•
9th - 12th Grade
20 questions
Unit 2 Lesson 3 Designing the Interface
Quiz
•
10th Grade
15 questions
Data Structures
Quiz
•
12th Grade
20 questions
mod 3 test
Quiz
•
9th - 12th Grade
15 questions
HTML 2: Lists
Quiz
•
8th - 10th Grade
20 questions
Array
Quiz
•
12th Grade
15 questions
App Lab
Quiz
•
9th Grade
20 questions
Python Functions and Error Handling
Quiz
•
10th Grade - University
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
25 questions
Spanish preterite verbs (irregular/changed)
Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)
Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1
Quiz
•
9th - 12th Grade
26 questions
June 19th
Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope
Quiz
•
10th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
27 questions
STAAR English 1 Review
Quiz
•
9th Grade