1+ {
2+ "cells" : [
3+ {
4+ "cell_type" : " markdown" ,
5+ "source" : [
6+ " Dictionary\r\n " ,
7+ " -----------"
8+ ],
9+ "metadata" : {}
10+ },
11+ {
12+ "cell_type" : " code" ,
13+ "execution_count" : 3 ,
14+ "source" : [
15+ " employee = { 'name': 'Teja', 'age': 30, 'department': 'admin'}\r\n " ,
16+ " print(employee)\r\n " ,
17+ " print(employee['name'])\r\n " ,
18+ " print(employee['department'])"
19+ ],
20+ "outputs" : [
21+ {
22+ "output_type" : " stream" ,
23+ "name" : " stdout" ,
24+ "text" : [
25+ " {'name': 'Teja', 'age': 30, 'department': 'admin'}\n " ,
26+ " Teja\n " ,
27+ " admin\n "
28+ ]
29+ }
30+ ],
31+ "metadata" : {}
32+ },
33+ {
34+ "cell_type" : " code" ,
35+ "execution_count" : 4 ,
36+ "source" : [
37+ " # Lets create a dictionary to store a movie record\r\n " ,
38+ " \r\n " ,
39+ " movie = {\r\n " ,
40+ " 'title': 'Bahubali',\r\n " ,
41+ " 'director': 'SS Rajamouli',\r\n " ,
42+ " 'year': '2016',\r\n " ,
43+ " 'rating': '8.8'\r\n " ,
44+ " }\r\n " ,
45+ " print(movie)"
46+ ],
47+ "outputs" : [
48+ {
49+ "output_type" : " stream" ,
50+ "name" : " stdout" ,
51+ "text" : [
52+ " {'title': 'Bahubali', 'director': 'SS Rajamouli', 'year': '2016', 'rating': '8.8'}\n "
53+ ]
54+ }
55+ ],
56+ "metadata" : {}
57+ },
58+ {
59+ "cell_type" : " code" ,
60+ "execution_count" : 5 ,
61+ "source" : [
62+ " movie = dict()\r\n " ,
63+ " movie['title'] = 'Bahubali'\r\n " ,
64+ " movie['director'] = 'SS Rajamouli'\r\n " ,
65+ " movie['year'] = 2016\r\n " ,
66+ " movie['rating'] = 8.8\r\n " ,
67+ " movie['actors'] = ['Prabhas', 'Rana', 'Anushka', 'Tamannah']\r\n " ,
68+ " print(movie)"
69+ ],
70+ "outputs" : [
71+ {
72+ "output_type" : " stream" ,
73+ "name" : " stdout" ,
74+ "text" : [
75+ " {'title': 'Bahubali', 'director': 'SS Rajamouli', 'year': 2016, 'rating': 8.8}\n "
76+ ]
77+ }
78+ ],
79+ "metadata" : {}
80+ }
81+ ],
82+ "metadata" : {
83+ "orig_nbformat" : 4 ,
84+ "language_info" : {
85+ "name" : " python" ,
86+ "version" : " 3.9.4" ,
87+ "mimetype" : " text/x-python" ,
88+ "codemirror_mode" : {
89+ "name" : " ipython" ,
90+ "version" : 3
91+ },
92+ "pygments_lexer" : " ipython3" ,
93+ "nbconvert_exporter" : " python" ,
94+ "file_extension" : " .py"
95+ },
96+ "kernelspec" : {
97+ "name" : " python3" ,
98+ "display_name" : " Python 3.9.4 64-bit"
99+ },
100+ "interpreter" : {
101+ "hash" : " 63fd5069d213b44bf678585dea6b12cceca9941eaf7f819626cde1f2670de90d"
102+ }
103+ },
104+ "nbformat" : 4 ,
105+ "nbformat_minor" : 2
106+ }
0 commit comments