Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

MAT 215 Chapter 6 Exam With Complete Solutions

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
12-03-2026
Written in
2025/2026

MAT 215 Chapter 6 Exam With Complete Solutions...

Institution
MAT 215
Course
MAT 215

Content preview

MAT 215 Chapter 6 Exam With
Complete Solutions

Which of the following statements is false?
a. Lists and tuples are built-in sequence collections.
b. Dictionaries, strings and sets are built-in non-sequence collections.
c. A dictionary is an unordered collection which stores key-value pairs that map
immutable keys to values,
just as a conventional dictionary maps words to definitions.
d. A set is an unordered collection of unique immutable elements. - ANSWER
Answer: b. Actually, dictionaries and sets are built-in non-sequence collections,
but strings are
built-in sequence collections

Which of the following statements a), b) or c) is false?
a. A dictionary associates keys with values. Each key maps to a specific value.
b. A dictionary's keys must be mutable (such as strings, numbers or tuples) and
unique (that is, no
duplicates).
c. Multiple keys can have the same value, such as two different inventory codes
that have the same
quantity in stock.
d. All of the above statements are true. - ANSWER Answer: b. Actually, a
dictionary's keys must be immutable (such as strings, numbers or tuples)
and unique (that is, no duplicates)

Which of the following statements is false?
a. You can create a dictionary by enclosing in curly braces, {}, a comma-
separated list of key-value pairs,
each of the form key: value.
b. You can create an empty dictionary with {}.
c. The following statement creates a dictionary with the country-name keys
'Finland', 'South Africa'
and 'Nepal' and their corresponding Internet country code values 'fi', 'za' and
'np':
country_codes = {'Finland', 'fi', 'South Africa', 'za',
'Nepal', 'np'}
d. When you output a dictionary, its comma-separated list of key-value pairs is
always enclosed in curly
braces. - ANSWER Answer: c. Actually, the following code creates a dictionary
with the country-name keys

, 'Finland', 'South Africa' and 'Nepal' and their corresponding Internet country
code values
'fi', 'za' and 'np':
country_codes = {'Finland': 'fi', 'South Africa': 'za',
'Nepal': 'np'}

Which of the following statements is false?
a. When you pass a dictionary to built-in function len, the function returns the
number of key-value pairsin the dictionary.
b. You can use a dictionary as a condition to determine if it's empty—a non-
empty dictionary evaluates to
True.
c. An empty dictionary evaluates to False.
d. Method clean deletes the dictionary's key-value pairs: - ANSWER Answer: d.
Actually, method clear deletes the dictionary's key-value pairs.

terating through a Dictionary
6.2 Q4: Which of the following statements a), b) and c) is false?
a. The following dictionary maps month-name strings to int values representing
the numbers of days in
the corresponding month:
days_per_month = {'January' : 31 , 'February' : 28 , 'March' : 31 }
b. Multiple keys in a dictionary can have the same value.
c. The following for statement iterates through dictionary days_per_month's key-
value pairs.
Dictionary method items returns each key-value pair as a tuple, which is
unpacked into the target
variables month and days:
for month, days in days_per_month.items():
print(f' {month} has {days} days' )
d. All of the above statements are true. - ANSWER Answer: b. Actually, multiple
values in a dictionary can have the same value. Keys must be unique

Which of the following statements a), b) or c) is false?
a. The following code creates the dictionary roman_numerals, which maps
roman numerals to their
integer equivalents (the value for 'X' is intentionally wrong):
roman_numerals = {'I' : 1 , 'II' : 2 , 'III' : 3 , 'V' : 5 , 'X' : 100 }
b. The following code gets the value associated with the key 'V' in Part (a):
roman_numerals['V' ]
c. You can update a key's associated value in an assignment statement. The
following code replaces the
incorrect value associated with the key 'X' in Part (a):
roman_numerals['X' ] = 10
d. All of the above statements are true. - ANSWER Answer: d.

Written for

Institution
MAT 215
Course
MAT 215

Document information

Uploaded on
March 12, 2026
Number of pages
9
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$19.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Evergreenview Harvard University
View profile
Follow You need to be logged in order to follow users or courses
Sold
13
Member since
1 year
Number of followers
1
Documents
2836
Last sold
4 days ago

4.8

5 reviews

5
4
4
1
3
0
2
0
1
0

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions