### Chapter 14 Tuples, Sets, and Dictionaries

Section 14.2 Tuples

*14.1*Suppose t = (1, 2, 4, 3), which of the following is incorrect?

*14.2*Suppose t = (1, 2, 4, 3), t[1 : 3] is _________.

*14.3*Suppose t = (1, 2, 4, 3), t[1 : -1] is _________.

*14.4*Suppose t = (1, 2, 4, 3, 8, 9), [t[i] for i in range(0, len(t), 2)] is _________.

*14.5*Suppose t = (1, 2), 2 * t is _________.

*14.6*Suppose t1 = (1, 2, 4, 3) and t2 = (1, 2, 3, 4), t1 < t2 is ________.

*14.7*Which of the following statements produces {'a', 'b', 'c'}?

*14.8*You can use ___________ to create an empty set.

*14.9*Given two sets s1 and s2, s1 < s2 is _________.

*14.10*Suppose s = {1, 2, 4, 3}, _______ returns 4.

*14.11*Suppose s = {1, 2, 4, 3}, which of the following is incorrect?

*14.12*Suppose s = {1, 2, 4, 3}, what happens when invoking s.add(4)?

*14.13*Suppose s = {1, 2, 4, 3}, what happens when invoking s.remove(12)?

*14.14*Suppose s1 = {1, 2, 4, 3} and s2 = {1, 3, 4, 2}, ________ is true.

*14.15*Suppose s1 = {1, 2, 4, 3} and s2 = {0, 1, 5, 3, 4, 2, 13}, ________ is true.

*14.16*Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1 | s2?

*14.17*Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1 - s2?

*14.18*Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1 & s2?

*14.19*Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1 ^ s2?

*14.20*Which of the following statement is false?

*14.21*You can have duplicate elements in a ________?

*14.22*The elements in a ________ are ordered?

*14.23*Suppose s = {1, 2}, 2 * s is _________.

*14.24*Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, s1 + s2 is ____________?

*14.25*Which of the following statements create a dictionary?

*14.26*Suppose d = {"john":40, "peter":45}, the keys are __________

*14.27*Suppose d = {"john":40, "peter":45}, "john" in d is __________

*14.28*Suppose d1 = {"john":40, "peter":45} and d2 = {"john":466, "peter":45}, d1 == d2 is _______.

*14.29*Suppose d1 = {"john":40, "peter":45} and d2 = {"john":466, "peter":45}, d1 > d2 is _______.

*14.30*Suppose d = {"john":40, "peter":45}, d["john"] is __________

*14.31*Suppose d = {"john":40, "peter":45}, to delete the entry for "john":40, use ________.

*14.32*Suppose d = {"john":40, "peter":45}, to obtain the number of entries in dictionary, use ________.

*14.33*What will be displayed by the following code?

d = {"john":40, "peter":45}

print(list(d.keys()))

*14.34*Suppose d = {"john":40, "peter":45}, what happens when retieving a value using d["susan"]?

*14.35*Suppose d = {"john":40, "peter":45}, what happens when retieving a value using d.get("susan")?

*14.36*Which of the following statements are true?

*14.37*Which of the following is a Python list?

*14.38*Which of the following is a Python tuple?

*14.39*Which of the following is a Python set?

*14.40*Which of the following is a Python dictionary?

*14.41*Which of the following sets is equal to {1, 2, 3}?