
Unit-V-Set Q & A

Quiz
•
Computers
•
Professional Development
•
Hard
Ajitha Padmanabhan
Used 2+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Indicate all of the following that are syntactically correct for creating a set.
set([1, 2, 3])
set((1, 2, 3))
{1, 2, 3}
[1,2,3]
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
For set s containing values 1, 2, 3, and set t containing 3, 4, 5, which of the following are the correct results for each given set operation?
(a) s | t -> {3}
s & t -> {1, 2, 3, 4, 5}
s - t->{1, 2}
s ^ t -> {1, 2, 4, 5}
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
For set s containing values 1, 2, 3 and set w of type frozenset containing values 'a','b','c', which of the following are valid set operations?
'a' in s
'a' in w
len(s) + len(w)
s.add(4)
w.add('d')
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A dictionary type in Python is an associative data structure that is accessed by a _______________ rather than an index value.
key
value
key value
index
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Associative data structures such as the dictionary type in Python are useful for,
accessing elements more intuitively than by use of an indexed data structure
maintaining elements in a particular order
insert and update
delete and drop
6.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following types can be used as a key in Python dictionaries?
strings
lists
tuples
numerical values
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a syntactically correct sequence, s, for dynamically creating a dictionary using dict(s).
s = [[1: 'one'],
[2: 'two'], [3: 'three']]
s = [[1, 'one'], [2, 'two'], [3, 'three']]
s = {1:'one', 2:'two', 3:'three'}
s ={[1:'one', 2:'two', 3:'three']}
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
For dictionary d = {'apples':0.66,'pears':1.25,'bananas':0.49}, which of the following correctly updates the price of bananas.
d[2] = 0.52
d[0.49] = 0.52
d['bananas'] = 0.52
d['bananas'] [ 0.52]
Similar Resources on Wayground
10 questions
11142020_A+_Lesson_9_Quiz

Quiz
•
Professional Development
7 questions
Salesforce Coding Quiz

Quiz
•
Professional Development
8 questions
Fake News April 2024

Quiz
•
Professional Development
10 questions
Daily Quiz (24.12.20)

Quiz
•
7th Grade - Professio...
10 questions
Kubernetes Clase6

Quiz
•
Professional Development
10 questions
Networking Basics

Quiz
•
Professional Development
10 questions
JavaScript. Тест для учащихся

Quiz
•
Professional Development
11 questions
KSK1024 - 1

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade