You are on page 1of 2

Name: Grade:

Dictionary in python.
1. Give a definition to a dictionary.
________________________________________________________________
________________________________________________________________
_______________________________________________
2. look at the code, name where is the key, name of a dictionary, and values
of keys

a. Name of dictionary___________________
b. Keys______________________
c. Values_______________________
3. Create a dictionary which has 2 items or pairs. The first item has key
“Login” and its value ”User356”, the second one has key “Password” its
value 12345678. Then print out the dictionary.

4. Write a program to create any dictionary with any 3 items using built-in
dict() function.

5. Write a program to retrieve a value of “model” key. The result should be


print out in the console. You can use method [] or get().
Name: Grade:

6. Look at the code. Clear all items at once using proper method and print out
the result.

7. This is the dictionary. Delete the dictionary using the proper mehod.

7. Write a program to remove the item “electric”and return its value.

8. write a program to make a copy of a dictionary with the copy() method:

You might also like