Create a Student Dictionary
Python
10 pts
Create a Student Dictionary
Create a dictionary called student with these three pairs, in this order:
"name":"Selam""age":16(a number)"city":"Asmara"
Then print the dictionary, and on the next line print its length with len().
Expected output:
{'name': 'Selam', 'age': 16, 'city': 'Asmara'}
3
Checklist
- Keep
studentas a dictionary written with curly brackets. - Add the
"age"and"city"pairs after the name, in that order, with the age as a number. - Print the dictionary, then its length.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
