Quizz

SCORE:

score


1. The built-in data object used to store a collection of items that are ordered and mutable is called a(n) _____.


2. To add an item to a list, you can use the _____ method.


3. To check if a certain key is present in a dictionary, you can use the _____ operator.


4. The built-in Python data object used to store a collection of items that are unordered and unmutable is called a _____.


5. The _____ function is used to convert a tuple to a list.


6. What is the output of the following code ?

a=['car', 'bag']
b=['bag', 'bed']
a.extend(b)
print(a)

7. What is the output of the following code ?

s=set()
print(s)

8. To remove a key-value pair from a dictionary, you can use the _____ method.


9. To concatenate two strings, you can use the _____ operator.


10. What is the output of the following code ?

s="strings are a series of characters"
print(s.title())

11. What is the output of the following code ?

myDict1 = {'a': 6, 'b': 8}
myDict2= {'a': 8}
myDict1.update(myDict2)
print(myDict1)    

12.The _____ function is used to find the length of a data object. a) len() b) count() c) size() d) length()


13. Which of the following looks like a tuple ?


14. What is the output of the following code ?

myDict1 = {'a': 6, 'b': 8}
myDict1 = {'a': 6, 'b': 8}
print(myDict1.get('b'))

15. To remove the first occurence of a specific value from a list, you can use the _____ method.


16. To remove an element from a set, you can use the _____ method.


17. To find the minimum value in a list, you can use the _____ function.


18. What is the output of the following code ?

mylist=['phone', 'wallet', 'umbrella','phone']
mylist.remove('phone')    

19. What is the possible output of the following code ?

set1={'blue', 'green', 'red'}
set2={'black','orange'}
print(set1.union(set2))

20. What is the output of the following code ?

s1=['h', 'e', 'l', 'l', 'o']
print('-'.join(s1))