Skip to content

Commit 6699571

Browse files
committed
Batch 4 Assignments and Notes
1 parent 69a8464 commit 6699571

16 files changed

+7233
-0
lines changed

Batch-4/Day 2/Assignment Day 2.pdf

159 KB
Binary file not shown.

Batch-4/Day 2/Day 2 Notes.ipynb

+1,585
Large diffs are not rendered by default.

Batch-4/Day 3/Assignment Day 3.pdf

181 KB
Binary file not shown.

Batch-4/Day 3/Day 3 Notes.ipynb

+1,013
Large diffs are not rendered by default.

Batch-4/Day-4/Assignment Day 4 .ipynb

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 9,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"#Function for caluclator for +,-,*,/ \n",
10+
"\n",
11+
"def calculator(num1,num2,op):\n",
12+
" if op == \"+\":\n",
13+
" return num1 +num2\n",
14+
" elif op == \"-\":\n",
15+
" return num1 -num2 \n",
16+
" elif op == \"*\":\n",
17+
" return num1 * num2\n",
18+
" elif op == \"/\":\n",
19+
" return num1 / num2\n",
20+
" else:\n",
21+
" return \"Give proper Operand, +, - , *, /\""
22+
]
23+
},
24+
{
25+
"cell_type": "code",
26+
"execution_count": 10,
27+
"metadata": {},
28+
"outputs": [
29+
{
30+
"data": {
31+
"text/plain": [
32+
"32"
33+
]
34+
},
35+
"execution_count": 10,
36+
"metadata": {},
37+
"output_type": "execute_result"
38+
}
39+
],
40+
"source": [
41+
"calculator(45,13,'-')"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 11,
47+
"metadata": {},
48+
"outputs": [
49+
{
50+
"data": {
51+
"text/plain": [
52+
"'Give proper Operand, +, - , *, /'"
53+
]
54+
},
55+
"execution_count": 11,
56+
"metadata": {},
57+
"output_type": "execute_result"
58+
}
59+
],
60+
"source": [
61+
"calculator(45,13,'k')"
62+
]
63+
},
64+
{
65+
"cell_type": "markdown",
66+
"metadata": {},
67+
"source": [
68+
"# Assignment number 1 \n",
69+
"\n",
70+
"Write a program to identify sub list [1,1,5] is there in the given list in the same order, if yes print “it's a Match” if no then print “it's Gone” in function\n",
71+
"\n",
72+
"Example - \n",
73+
"Listy = [1,5,6,4,1,2,3,5] - it's a Match\n",
74+
"Listy = [1,5,6,5,1,2,3,6] - it's Gone"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": 17,
80+
"metadata": {},
81+
"outputs": [
82+
{
83+
"name": "stdout",
84+
"output_type": "stream",
85+
"text": [
86+
" it's Gone \n"
87+
]
88+
}
89+
],
90+
"source": [
91+
"listy = [1,5,6,4,1,2,3]\n",
92+
"\n",
93+
"sub_list = [1,1,5]\n",
94+
"\n",
95+
"\n",
96+
"for item in listy:\n",
97+
" if item == sub_list[0]:\n",
98+
" sub_list.pop(0)\n",
99+
" \n",
100+
"if len(sub_list) == 0:\n",
101+
" print(\" it's a Match \")\n",
102+
"else:\n",
103+
" print(\" it's Gone \")"
104+
]
105+
},
106+
{
107+
"cell_type": "code",
108+
"execution_count": null,
109+
"metadata": {},
110+
"outputs": [],
111+
"source": []
112+
},
113+
{
114+
"cell_type": "code",
115+
"execution_count": null,
116+
"metadata": {},
117+
"outputs": [],
118+
"source": []
119+
}
120+
],
121+
"metadata": {
122+
"kernelspec": {
123+
"display_name": "Python 3",
124+
"language": "python",
125+
"name": "python3"
126+
},
127+
"language_info": {
128+
"codemirror_mode": {
129+
"name": "ipython",
130+
"version": 3
131+
},
132+
"file_extension": ".py",
133+
"mimetype": "text/x-python",
134+
"name": "python",
135+
"nbconvert_exporter": "python",
136+
"pygments_lexer": "ipython3",
137+
"version": "3.7.4"
138+
}
139+
},
140+
"nbformat": 4,
141+
"nbformat_minor": 2
142+
}

Batch-4/Day-4/Assignment Day 4.pdf

168 KB
Binary file not shown.

0 commit comments

Comments
 (0)