Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c0c66a5

Browse files
Second Day
1 parent 9161e96 commit c0c66a5

File tree

7 files changed

+1729
-187
lines changed

7 files changed

+1729
-187
lines changed

‎Conditional_Statments.ipynb‎

Lines changed: 0 additions & 180 deletions
This file was deleted.

‎First Day/Conditional_Statments.ipynb‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,6 @@
147147
"print(operation)\n",
148148
"print(\"Result\",result)"
149149
]
150-
},
151-
{
152-
"cell_type": "code",
153-
"execution_count": null,
154-
"metadata": {},
155-
"outputs": [],
156-
"source": []
157150
}
158151
],
159152
"metadata": {

‎Second Day/List2.ipynb‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,31 @@
395395
"fruits.extend(cars)\n",
396396
"fruits"
397397
]
398+
},
399+
{
400+
"cell_type": "code",
401+
"execution_count": 23,
402+
"metadata": {},
403+
"outputs": [
404+
{
405+
"name": "stdout",
406+
"output_type": "stream",
407+
"text": [
408+
"Enter the size:\n",
409+
"5\n",
410+
"[1, 2, 3, 4, 5]\n"
411+
]
412+
}
413+
],
414+
"source": [
415+
"list=[]\n",
416+
"a=int(input(print(\"Enter the size:\")))\n",
417+
"print(a)\n",
418+
"for i in range(0,a):\n",
419+
" ele = int(input())\n",
420+
" list.append(ele)\n",
421+
"print(list)"
422+
]
398423
}
399424
],
400425
"metadata": {

‎Second Day/Tuple2.ipynb‎

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 4,
6+
"metadata": {},
7+
"outputs": [
8+
{
9+
"name": "stdout",
10+
"output_type": "stream",
11+
"text": [
12+
"[[1, 2, 3], [4, 5, 7], [6, 9, 7]]\n"
13+
]
14+
},
15+
{
16+
"data": {
17+
"text/plain": [
18+
"9"
19+
]
20+
},
21+
"execution_count": 4,
22+
"metadata": {},
23+
"output_type": "execute_result"
24+
}
25+
],
26+
"source": [
27+
"## Nested List-Tuple\n",
28+
"lst=[[1,2,3],[4,5,7],[6,9,7]]\n",
29+
"print(lst)\n",
30+
"lst[0] # firdt element\n",
31+
"lst[2][1] # third list's 2nd ele"
32+
]
33+
},
34+
{
35+
"cell_type": "code",
36+
"execution_count": 6,
37+
"metadata": {},
38+
"outputs": [
39+
{
40+
"data": {
41+
"text/plain": [
42+
"[1, 2]"
43+
]
44+
},
45+
"execution_count": 6,
46+
"metadata": {},
47+
"output_type": "execute_result"
48+
}
49+
],
50+
"source": [
51+
"# slicing in nested-list\n",
52+
"lst[0][0:2]"
53+
]
54+
},
55+
{
56+
"cell_type": "code",
57+
"execution_count": 7,
58+
"metadata": {},
59+
"outputs": [
60+
{
61+
"data": {
62+
"text/plain": [
63+
"(6, 9, 7, 'c')"
64+
]
65+
},
66+
"execution_count": 7,
67+
"metadata": {},
68+
"output_type": "execute_result"
69+
}
70+
],
71+
"source": [
72+
"lst=[[1,2,3],[4,5,7],(6,9,7,\"c\")]\n",
73+
"lst[2]"
74+
]
75+
},
76+
{
77+
"cell_type": "code",
78+
"execution_count": 13,
79+
"metadata": {},
80+
"outputs": [
81+
{
82+
"data": {
83+
"text/plain": [
84+
"(True, False)"
85+
]
86+
},
87+
"execution_count": 13,
88+
"metadata": {},
89+
"output_type": "execute_result"
90+
}
91+
],
92+
"source": [
93+
"nested_tuple = ((1,\"hello\",3),(True,False),(\"e\",\"hello\",5),(454,46,45))\n",
94+
"nested_tuple[1]"
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": 14,
100+
"metadata": {},
101+
"outputs": [
102+
{
103+
"name": "stdout",
104+
"output_type": "stream",
105+
"text": [
106+
"1 hello 3 \n",
107+
"True False \n",
108+
"e hello 5 \n",
109+
"454 46 45 \n"
110+
]
111+
}
112+
],
113+
"source": [
114+
"#iterating over nested tuples\n",
115+
"\n",
116+
"for i in nested_tuple:\n",
117+
" for j in i:\n",
118+
" print(j,end=\" \")\n",
119+
" print()\n"
120+
]
121+
},
122+
{
123+
"cell_type": "code",
124+
"execution_count": null,
125+
"metadata": {},
126+
"outputs": [],
127+
"source": []
128+
}
129+
],
130+
"metadata": {
131+
"kernelspec": {
132+
"display_name": "base",
133+
"language": "python",
134+
"name": "python3"
135+
},
136+
"language_info": {
137+
"codemirror_mode": {
138+
"name": "ipython",
139+
"version": 3
140+
},
141+
"file_extension": ".py",
142+
"mimetype": "text/x-python",
143+
"name": "python",
144+
"nbconvert_exporter": "python",
145+
"pygments_lexer": "ipython3",
146+
"version": "3.11.7"
147+
}
148+
},
149+
"nbformat": 4,
150+
"nbformat_minor": 2
151+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /