Test 2 Python
Test 2 Python
1. colors=[“red”,”green”,”pink”,”blue”]
colors[2]
Find output
a. blue b. green
c. pink d. red
2. Which of these will return Chennai from the given list.
Cities=[“Salem”, “Erode”, “Mumbai”, ”Chennai”]
a. Cities( ) b. Cities[3]
b. Cities(3) d. Cities(‘3’)
3. Fruits=[“apple”,”banana”]
Mango in Fruits
a. True b. False
c.true d. false
4. c={1,"hi","well"}
i) d=c.copy()
ii ) d.update(c)
iii ) d=c
identify the correct answer
a) i is correct
b) i,ii correct
c) i and iii are correct
d) all are correct
5. c=["devi","sita"]
c.index("kavitha")
a. name error b. value error c. -1 d. 0
6. Which method returns a new set with all items from
both sets by removing duplicates.
a. union( ) b.append( ) c. extend( ) d. remove ( )
7. Which of these about the dictionary is false