Quiz on List and Tuples
Quiz
•
Computers
•
University
•
Hard
spandan gunti
Used 26+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
a=[1,2,3,4,5,6,7,8,9]
print(a[::2])
[1,2]
[8,9]
[1,3,5,7,9]
[1,2,3]
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following code snippet?
a=[1,2,3,4,5,6,7,8,9]
a[::2]=10,20,30,40,50,60
print(a)
ValueError: attempt to assign sequence of size 6 to extended slice of size 5
[10, 2, 20, 4, 30, 6, 40, 8, 50, 60]
[1, 2, 10, 20, 30, 40, 50, 60]
[1, 10, 3, 20, 5, 30, 7, 40, 9, 50, 60]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet?
arr = [[1, 2, 3, 4],
[4, 5, 6, 7],
[8, 9, 10, 11],
[12, 13, 14, 15]]
for i in range(0, 4):
print(arr[i].pop())
1 2 3 4
1 4 8 12
4 7 11 15
12,13,14,15
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following code snippet?
a=[1,2,3,4,5]
print(a[3:0:-1])
Syntax error
[4, 3, 2]
[4, 3]
[4, 3, 2, 1]
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following list
l1=[1,2,3]
L1 = [1,2,3]+[4,5,6]
what is L1
[1,2,3,5,7,9]
[1,2,3]
[4,5,6]
[1,2,3,4,5,6]
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Python, list is mutable
True
False
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these pieces of code would return the name "Harry" from the following list?
nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
nameList()
nameList[1]
NameList(4)
nameList["4"]
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
19 questions
DBMS - Fundamentals
Quiz
•
University
20 questions
Latihan PSAS Kelas 9
Quiz
•
9th Grade - University
13 questions
PWM y ADC con el MSP430F5529
Quiz
•
University
14 questions
How the Internet Works
Quiz
•
4th Grade - University
14 questions
Excel Bezüge und Funktionen - SUMME, MAX, MIN, MITTELWERT
Quiz
•
University
15 questions
8051-MCQ
Quiz
•
University
11 questions
Youtube
Quiz
•
4th Grade - University
20 questions
Name The Disney Animation Films
Quiz
•
KG - University
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Computers
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
12 questions
Halloween
Quiz
•
3rd Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
History of Halloween: Pagan or Christian?
Interactive video
•
11th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
