Skip to content

Commit 31e4856

Browse files
Add files via upload
1 parent 0dbc9e3 commit 31e4856

8 files changed

+1454
-0
lines changed
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {
7+
"scrolled": true
8+
},
9+
"outputs": [
10+
{
11+
"data": {
12+
"text/plain": [
13+
"[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]"
14+
]
15+
},
16+
"execution_count": 1,
17+
"metadata": {},
18+
"output_type": "execute_result"
19+
}
20+
],
21+
"source": [
22+
"li = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]]\n",
23+
"li"
24+
]
25+
},
26+
{
27+
"cell_type": "code",
28+
"execution_count": 2,
29+
"metadata": {
30+
"scrolled": true
31+
},
32+
"outputs": [
33+
{
34+
"data": {
35+
"text/plain": [
36+
"11"
37+
]
38+
},
39+
"execution_count": 2,
40+
"metadata": {},
41+
"output_type": "execute_result"
42+
}
43+
],
44+
"source": [
45+
"li[2][2]"
46+
]
47+
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": 3,
51+
"metadata": {},
52+
"outputs": [
53+
{
54+
"data": {
55+
"text/plain": [
56+
"12"
57+
]
58+
},
59+
"execution_count": 3,
60+
"metadata": {},
61+
"output_type": "execute_result"
62+
}
63+
],
64+
"source": [
65+
"li[2][3]"
66+
]
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": 4,
71+
"metadata": {},
72+
"outputs": [
73+
{
74+
"ename": "IndexError",
75+
"evalue": "list index out of range",
76+
"output_type": "error",
77+
"traceback": [
78+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
79+
"\u001b[1;31mIndexError\u001b[0m Traceback (most recent call last)",
80+
"\u001b[1;32m<ipython-input-4-8a1343be0e21>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mli\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m5\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
81+
"\u001b[1;31mIndexError\u001b[0m: list index out of range"
82+
]
83+
}
84+
],
85+
"source": [
86+
"li[2][5]"
87+
]
88+
},
89+
{
90+
"cell_type": "code",
91+
"execution_count": 5,
92+
"metadata": {},
93+
"outputs": [
94+
{
95+
"data": {
96+
"text/plain": [
97+
"[[1, 2, 3, 4], [5, 6, 20, 8], [9, 10, 11, 12], [13, 14, 15, 16]]"
98+
]
99+
},
100+
"execution_count": 5,
101+
"metadata": {},
102+
"output_type": "execute_result"
103+
}
104+
],
105+
"source": [
106+
"li[1][2]=20\n",
107+
"li"
108+
]
109+
}
110+
],
111+
"metadata": {
112+
"kernelspec": {
113+
"display_name": "Python 3",
114+
"language": "python",
115+
"name": "python3"
116+
},
117+
"language_info": {
118+
"codemirror_mode": {
119+
"name": "ipython",
120+
"version": 3
121+
},
122+
"file_extension": ".py",
123+
"mimetype": "text/x-python",
124+
"name": "python",
125+
"nbconvert_exporter": "python",
126+
"pygments_lexer": "ipython3",
127+
"version": "3.8.5"
128+
}
129+
},
130+
"nbformat": 4,
131+
"nbformat_minor": 4
132+
}
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {
7+
"scrolled": true
8+
},
9+
"outputs": [
10+
{
11+
"data": {
12+
"text/plain": [
13+
"[[1, 2, 3, 4], [5, 6, 7, 8]]"
14+
]
15+
},
16+
"execution_count": 1,
17+
"metadata": {},
18+
"output_type": "execute_result"
19+
}
20+
],
21+
"source": [
22+
"li = [[1,2,3,4],[5,6,7,8]]\n",
23+
"li"
24+
]
25+
},
26+
{
27+
"cell_type": "code",
28+
"execution_count": 2,
29+
"metadata": {},
30+
"outputs": [
31+
{
32+
"data": {
33+
"text/plain": [
34+
"[1, 2, 3, 4]"
35+
]
36+
},
37+
"execution_count": 2,
38+
"metadata": {},
39+
"output_type": "execute_result"
40+
}
41+
],
42+
"source": [
43+
"li[0]"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": 3,
49+
"metadata": {
50+
"scrolled": true
51+
},
52+
"outputs": [
53+
{
54+
"data": {
55+
"text/plain": [
56+
"list"
57+
]
58+
},
59+
"execution_count": 3,
60+
"metadata": {},
61+
"output_type": "execute_result"
62+
}
63+
],
64+
"source": [
65+
"type(li[0])"
66+
]
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": 4,
71+
"metadata": {
72+
"scrolled": true
73+
},
74+
"outputs": [
75+
{
76+
"data": {
77+
"text/plain": [
78+
"2"
79+
]
80+
},
81+
"execution_count": 4,
82+
"metadata": {},
83+
"output_type": "execute_result"
84+
}
85+
],
86+
"source": [
87+
"li[0][1]"
88+
]
89+
},
90+
{
91+
"cell_type": "code",
92+
"execution_count": 5,
93+
"metadata": {
94+
"scrolled": true
95+
},
96+
"outputs": [
97+
{
98+
"data": {
99+
"text/plain": [
100+
"[[1, 4, 3, 4], [5, 6, 7, 8]]"
101+
]
102+
},
103+
"execution_count": 5,
104+
"metadata": {},
105+
"output_type": "execute_result"
106+
}
107+
],
108+
"source": [
109+
"li[0][1]=4\n",
110+
"li"
111+
]
112+
},
113+
{
114+
"cell_type": "code",
115+
"execution_count": 6,
116+
"metadata": {
117+
"scrolled": true
118+
},
119+
"outputs": [
120+
{
121+
"data": {
122+
"text/plain": [
123+
"1839499451136"
124+
]
125+
},
126+
"execution_count": 6,
127+
"metadata": {},
128+
"output_type": "execute_result"
129+
}
130+
],
131+
"source": [
132+
"id(li)"
133+
]
134+
},
135+
{
136+
"cell_type": "code",
137+
"execution_count": 7,
138+
"metadata": {
139+
"scrolled": true
140+
},
141+
"outputs": [
142+
{
143+
"data": {
144+
"text/plain": [
145+
"1839499450880"
146+
]
147+
},
148+
"execution_count": 7,
149+
"metadata": {},
150+
"output_type": "execute_result"
151+
}
152+
],
153+
"source": [
154+
"id(li[0])"
155+
]
156+
},
157+
{
158+
"cell_type": "code",
159+
"execution_count": 8,
160+
"metadata": {},
161+
"outputs": [
162+
{
163+
"data": {
164+
"text/plain": [
165+
"1839499451072"
166+
]
167+
},
168+
"execution_count": 8,
169+
"metadata": {},
170+
"output_type": "execute_result"
171+
}
172+
],
173+
"source": [
174+
"id(li[1])"
175+
]
176+
},
177+
{
178+
"cell_type": "code",
179+
"execution_count": 9,
180+
"metadata": {},
181+
"outputs": [],
182+
"source": [
183+
"li[1]=\"PArikh\""
184+
]
185+
},
186+
{
187+
"cell_type": "code",
188+
"execution_count": 10,
189+
"metadata": {
190+
"scrolled": true
191+
},
192+
"outputs": [
193+
{
194+
"data": {
195+
"text/plain": [
196+
"[[1, 4, 3, 4], 'PArikh']"
197+
]
198+
},
199+
"execution_count": 10,
200+
"metadata": {},
201+
"output_type": "execute_result"
202+
}
203+
],
204+
"source": [
205+
"li"
206+
]
207+
},
208+
{
209+
"cell_type": "code",
210+
"execution_count": 11,
211+
"metadata": {
212+
"scrolled": true
213+
},
214+
"outputs": [
215+
{
216+
"data": {
217+
"text/plain": [
218+
"[[1, 4, 3, 4], [6, 7, 8, 9]]"
219+
]
220+
},
221+
"execution_count": 11,
222+
"metadata": {},
223+
"output_type": "execute_result"
224+
}
225+
],
226+
"source": [
227+
"li[1]=[6,7,8,9]\n",
228+
"li"
229+
]
230+
}
231+
],
232+
"metadata": {
233+
"kernelspec": {
234+
"display_name": "Python 3",
235+
"language": "python",
236+
"name": "python3"
237+
},
238+
"language_info": {
239+
"codemirror_mode": {
240+
"name": "ipython",
241+
"version": 3
242+
},
243+
"file_extension": ".py",
244+
"mimetype": "text/x-python",
245+
"name": "python",
246+
"nbconvert_exporter": "python",
247+
"pygments_lexer": "ipython3",
248+
"version": "3.8.5"
249+
}
250+
},
251+
"nbformat": 4,
252+
"nbformat_minor": 4
253+
}

0 commit comments

Comments
 (0)