Data Structures & Operations
Python Coding Quiz - Data Structures & Operations
Answer the coding questions below by selecting all applicable options:
1. Which code snippets correctly create a list with elements 1, 2, and 3? (Select all that apply)
2. Which code snippets correctly create a dictionary with keys 'a' and 'b'? (Select all that apply)
3. Which code snippets correctly access the last element of a list my_list
? (Select all that apply)
4. Which of the following correctly removes an item from a set my_set
? (Select all that apply)
5. Which code snippets remove duplicates from a list my_list
? (Select all that apply)
6. Which methods add elements to a dictionary my_dict
? (Select all that apply)
7. Which code snippets correctly check if a dictionary my_dict
contains the key 'a'
? (Select all that apply)
8. Which code snippets correctly convert a list my_list
to a set? (Select all that apply)
9. Which methods retrieve the values from a dictionary my_dict
? (Select all that apply)
10. Which of the following correctly checks if 5 is in the list my_list
? (Select all that apply)