14. Tuples, Sets, and Dictionaries37 Questions
Created by Y. Daniel Liang
 http://www.cs.armstrong.edu/liang/index.html
Free

Suppose t = (1, 2, 4, 3), which of the following is incorrect?
Suppose t = (1, 2, 4, 3), t[1 : 3] is _________.
Suppose t = (1, 2, 4, 3), t[1 : 1] is _________.
Suppose t = (1, 2, 4, 3, 8, 9), [t[i] for i in range(0, len(t), 2)] is _________.
Suppose t = (1, 2), 2 * t is _________.
Which of the following statements produces {'a', 'b', 'c'}?
Given two sets s1 and s2, s1 < s2 is _________.
Suppose s = {1, 2, 4, 3}, _______ returns 4.
Suppose s = {1, 2, 4, 3}, which of the following is incorrect?
Suppose s = {1, 2, 4, 3}, what happens when invoking s.add(4)?
Suppose s = {1, 2, 4, 3}, what happens when invoking s.remove(12)?
Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1  s2?
Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1  s2?
Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1 & s2?
Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1 ^ s2?
Which of the following statement is false?
You can have duplicate elements in ________?
The elements in ________ are ordered?
Suppose s = {1, 2}, 2 * s is _________.
Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, s1 + s2 is ____________?
Which of the following statements create a dictionary?
Suppose d = {"john":40, "peter":45}, the keys are __________
Suppose d1 = {"john":40, "peter":45} and d2 = {"john":466, "peter":45}, d1 == d2 is
Suppose d1 = {"john":40, "peter":45} and d2 = {"john":466, "peter":45}, d1 > d2 is
Suppose d = {"john":40, "peter":45}, d["john"] is __________
Suppose d = {"john":40, "peter":45}, to delete the entry for "john":40, use ________.
Suppose d = {"john":40, "peter":45}, to obtain the number of entries in dictionary, use ________.
What will be displayed by the following code?
d = {"john":40, "peter":45}
print(list(d.keys()))
Suppose d = {"john":40, "peter":45}, what happens when retieving a value using d["susan"]?
Suppose d = {"john":40, "peter":45}, what happens when retieving a value using d.get("susan")?
Which of the following statements are true?
Which of the following is a Python list?
Which of the following is a Python tuple?
Which of the following is a Python set?
Which of the following is a Python dictionary?
Which of the following sets is equal to {1, 2, 3}?