
Python Lists ,set,tuple and Dictionary
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Roqia Tabassum
Used 5+ times
FREE Resource
Enhance your content in a minute
18 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 1 pt
The following table contains some examples of lists:
Answer explanation
Empty List
A List of Integers
A list of mixed data types
A List of Strings
A nested list
A deeply nested listEmpty List
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Select all the correct statements given below.
All elements in a list should be of same data type.
Lists are immutable.
Lists are ordered and can contain other lists as elements.
Indexing can be used with lists to access individual items only if there are no nested lists.
3.
OPEN ENDED QUESTION
3 mins • 2 pts
Write a python program for list by using extend and append methods.
SAMPLE TEST CASE
hi
hello
Lists
['hi', 'hello', 'Python']
['hi', 'hello', 'Python', 'Code is Life']
['hi', 'hello', 'Python', 'Code is Life', 45, 67, 89]
list1 = ["hi", "hello", "Lists"]
Evaluate responses using AI:
OFF
Answer explanation
hi
hello
Lists
['hi', 'hello', 'Python']
['hi', 'hello', 'Python', 'Code is Life']
['hi', 'hello', 'Python', 'Code is Life', 45, 67, 89]
list1 = ["hi", "hello", "Lists"]
4.
OPEN ENDED QUESTION
3 mins • 2 pts
Write a program to determine if a given element is present in a list or not. Print the result as shown in the sample test cases.
Sample Input and Output 1:
data: Python,Java,Perl
element: Java
True
Evaluate responses using AI:
OFF
Answer explanation
data: Python,Java,Perl
element: Java
True
5.
OPEN ENDED QUESTION
3 mins • 2 pts
Write a program to get list elements using slicing as shown in the example.
Sample Input and Output:
a = [9, 8, 7, 6, 5, 4]
a[0:3] = [9, 8, 7]
a[:4] = [9, 8, 7, 6]
a[:] = [9, 8, 7, 6, 5, 4]
a[2:2] = []
a[0:6:2] = [9, 7, 5]
a[-3:] = [6, 5, 4]
a[:-3] = [9, 8, 7]
Evaluate responses using AI:
OFF
Answer explanation
a[0:3] = [9, 8, 7]
a[:4] = [9, 8, 7, 6]
a[:] = [9, 8, 7, 6, 5, 4]
a[2:2] = []
a[0:6:2] = [9, 7, 5]
a[-3:] = [6, 5, 4]
a[:-3] = [9, 8, 7]
6.
FILL IN THE BLANK QUESTION
1 min • 1 pt
plist = ['red', 'orange', 'blue', 'green', 'yellow', 'cyan']
elem = plist.pop()
print(elem)________________________
elem = plist.pop(-1)
print(elem)_____________________________
print(plist)____________________________
7.
OPEN ENDED QUESTION
3 mins • 2 pts
Write a program to find the difference between the maximum and the minimum elements of a list and print the result as shown in the example.
Sample Input and Output:data: 12,52,96,85
min: 12
max: 96
difference: 84
Evaluate responses using AI:
OFF
Answer explanation
min: 12
max: 96
difference: 84
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
13 questions
docker advance
Quiz
•
University
20 questions
CSE493_QUIZ 1
Quiz
•
University
16 questions
Python
Quiz
•
University
20 questions
PHP First Internal Practical Viva
Quiz
•
University
20 questions
Hash
Quiz
•
University
16 questions
Principles of Information Technology
Quiz
•
9th Grade - University
13 questions
Principles of Programming
Quiz
•
KG - University
20 questions
Kiến thức về phần mềm soạn thảo
Quiz
•
6th Grade - University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University
