What is the output of the following list assignment
aList = [4, 8, 12, 16]
aList[1:4] = [20, 24, 28]
print(aList)
List Manipulations
Quiz
•
Computers, Other
•
11th Grade
•
Medium
Archana Pataskar
Used 150+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following list assignment
aList = [4, 8, 12, 16]
aList[1:4] = [20, 24, 28]
print(aList)
[4, 20, 24, 28, 8, 12, 16]
[4, 20, 24, 28]
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following list operation
aList = [10, 20, 30, 40, 50, 60, 70, 80]
print(aList[2:5])
print(aList[:4])
print(aList[3:])
[20, 30, 40, 50]
[10, 20, 30, 40]
[30, 40, 50, 60, 70, 80]
[30, 40, 50]
[10, 20, 30, 40]
[40, 50, 60, 70, 80]
None of these
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Select all the correct options to join two lists in Python
listOne = ['a', 'b', 'c', 'd']
listTwo = ['e', 'f', 'g']
newList = listOne + listTwo
newList = extend(listOne, listTwo)
newList = listOne.extend(listTwo)
newList.extend(listOne, listTwo)
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following list function?
sampleList = [10, 20, 30, 40, 50]
sampleList.append(60)
print(sampleList)
sampleList.append(60)
print(sampleList)
[10, 20, 30, 40, 50, 60]
[10, 20, 30, 40, 50, 60, 60]
[10, 20, 30, 40, 50, 60]
[10, 20, 30, 40, 50, 60]
both are wrong
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
In Python, list is mutable
False
True
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following would give an error?
list1=[]
list1=[]*3
list1=[2,8,7]
None of the above
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of below Python code?
list1=[8,0,9,5]
print(list1[::-1])
[5,9,0,8]
[8,0,9]
[8,0,9,5]
[0,9,5]
20 questions
Python list, if
Quiz
•
6th - 12th Grade
20 questions
Int Prog: Lists and Functions
Quiz
•
9th - 12th Grade
15 questions
grade XI Recapitulation
Quiz
•
11th - 12th Grade
16 questions
Lists
Quiz
•
9th - 12th Grade
15 questions
Kuis Python 1
Quiz
•
11th Grade
20 questions
File Handling in Python
Quiz
•
10th - 11th Grade
15 questions
CPM9.1-9.3 Quiz Review
Quiz
•
9th - 12th Grade
25 questions
12 CS Revision 1
Quiz
•
11th Grade
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