Question: 1 . ( 1 1 points: 1 point each ) The following are true / false questions. Write either T or F in the boxes
points: point each The following are truefalse questions. Write either T
or F in the boxes at the bottom of page If theres any counterexample, its
false.
a If a list in Python contains multiple identical items and you try to convert it
to a set, the program will crash.
b If you try to access a key that does not exist in a dictionary, Python will return
None.
c Using curly braces creates an empty set.
d The dictionary comprehension strx: for x in range is equivalent to the dictionary :::::
e The in operator can be used to check for the presence of an element in a
tuple, but it doesnt work on sets because sets have no order.
f The symmetric difference of two sets in Python can also be expressed as the
union of the two sets, minus their intersection.
g The pop method for dictionaries in Python removes the last added keyvalue
pair of the dictionary and returns it
h When iterating over a dictionary using a for loop, the loop variable refers to
the keys of the dictionary.
i You can loop over sets, but you cannot loop over tuples.
j Assuming s and s are both sets, the expression sdifferences can
return a different result from sdifferences
k Both lists and tuples in Python support adding elements after creation, but
unlike lists, elements in a tuple cannot be changed once added.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
