Module 5 Worksheet 1
Module 5 Worksheet 1
a) b
b) i
c) B
d) I
Answer:
a) True
b) False
Answer:
a) [2,3,3]
b) [6,9]
c) [2,3,2,3,2,3]
d) [2,3][2,3][2,3]
Answer:
Q.No 4. Square brackets in an assignment statement will create which type of data structure?
( s=[] )
a) List
b) queue
c) set
d) dictionary
Answer:
Q.No 5. To insert an the string "strawberries" in the first position of a list we use
a) fruit.append("strawberries, 1")
b) fruit.insert("strawberries",0)
c) fruit.insert(1, "strawberries")
d) fruit.insert(0, "strawberries")
Answer:
Q.No 6. Select the all correct way to remove the key marks from a dictionary
a) student.popitem("marks")
b) student.pop("marks")
c) del student["marks"]
d) student.remove("marks")
Answer:
a) True
b) False
Answer:
Q.No 8. Items are accessed by their position in a dictionary and All the keys in a dictionary must
be of the same type.
a) True
b) False
Answer:
a) Terminating a loop
b) Skipping the current iteration of a loop
Answer:
a) Sorting
Answer:
Q. No1. Dictionaries use _________ and keys are separated with _________
Answer:
Q.No.2. Comparing a dictionary to Python to a dictionary for words, ____________ is each word we look
up_______ is definition of the word
Answer:
Answer:
Q.No.4. The keyword used for conditional statements with multiple branches in Python is _______.
Answer:
Answer:
Match the following
Answer