- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
375 lines (361 loc) · 17.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="UTF-8" />
<metaname="viewport" content="width=device-width, initial-scale=1.0" />
<linkrel="shortcut icon" href="../images/dsa-logo.png" type="image/x-icon" />
<linkrel="stylesheet" href="../style.css" />
<linkrel="stylesheet" href="style.css">
<title>Learn DSA Using Python || Code Explorer</title>
</head>
<bodyclass="body">
<marqueeclass="marquee">Learn DSA Using Python || Lesson 02 - Python Revision || Code
Explorer</marquee>
<divclass="main-body">
<divclass="left">
<divclass="logo">
<imgsrc="../images/code.png" alt="" height="100px" width="100px" class="logo-img" />
<divclass="logo-div marquee">
<spanclass="code">Code</span><spanclass="explorer">Explorer</span>
</div>
<spanclass="dropdown"></span>
</div>
<hrclass="one" />
<divclass="hide-on-small-screen">
<spanclass="contents">Contents</span>
<hrclass="two nav-two" />
<ultype="none" class="nav-hidden">
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="../index.html">
<spanclass="lesson">Lesson 1 / Intro</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="index.html">
<spanclass="lesson">Lesson 2 / Python Revision</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="../lesson-03/index.html">
<spanclass="lesson">Lesson 3 / Data Structures</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="../lesson-04/index.html">
<spanclass="lesson">Lesson 4 / Algorithms</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 1 / Intro</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 2 / Revision</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 3 / Testing</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 4 / Output</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 1 / Intro</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 2 / Revision</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 3 / Testing</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 4 / Output</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 1 / Intro</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 2 / Revision</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 3 / Testing</span>
</a>
</li>
<hrclass="two" />
<li>
<imgsrc="../images/arrow.png" alt="" class="arrow-img" />
<ahref="https://youtube.com">
<spanclass="lesson">Lesson 4 / Output</span>
</a>
</li>
<hrclass="two" />
</ul>
</div>
</div>
<divclass="right">
<h1class="h1">
Welcome To DSA Complete Course Using Python By Code Explorer
</h1>
<hrclass="one" />
<h1class="h1">This Is A Quick Revision Of Python For This Course</h1>
<divclass="video-container">
<iframewidth="560" height="315" src="https://www.youtube.com/embed/EaUnN9SZmy8" title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen></iframe>
</div>
<center>
<divid="box">
<astyle="color: chartreuse;" href="https://www.youtube.com/watch?v=RQKJB7z-OqU&list=PLGxMeslbGNsU38f0599lOC-cRmrf01lD3&pp=iAQB"><span>Full
PlayList</span></a>
</div>
</center>
<hrclass="one" />
<pclass="p" style="color: aqua !important">
Python is a versatile programming language known for its simplicity
and readability, making it an excellent choice for both beginners and
experienced programmers. It provides an extensive set of libraries and
frameworks that make development faster and more efficient. Moreover,
Python's popularity has grown immensely over the years, making it one
of the most widely used programming languages.
</p>
<pclass="p" style="color: aqua !important">
When it comes to Data Structures and Algorithms (DSA), Python offers a
range of built-in data structures and comprehensive libraries that
simplify the implementation of algorithms. These features, combined
with Python's expressive syntax, make it an ideal language for working
with DSA.
</p>
<pclass="p" style="color: aqua !important">
Let's explore some of the key aspects of Python programming and its relevance to DSA :-
</p>
<pclass="p" style="color: aqua !important">
<olstyle="padding-left: 50px; padding-right: 20px;">
<listyle="display: block !important; color: aqua; padding-bottom: 10px;"><span
style="color: chartreuse !important; font-style: italic; font-family: cursive;">Readability and
Simplicity:</span> Python emphasizes code readability, utilizing an elegant and intuitive syntax.
This makes it easier to understand and maintain code, especially when dealing with complex data structures and
algorithms. Python's minimalist design philosophy encourages developers to write clean and concise code,
reducing the likelihood of errors and making it easier to reason about DSA implementations.
</li>
<listyle="display: block !important; color: aqua; padding-bottom: 10px;"><span
style="color: chartreuse !important; font-style: italic; font-family: cursive;">Data Structures:</span>
Python provides a variety of built-in data
structures, such as lists, tuples, dictionaries,
sets, and more. These data structures are versatile and efficient, allowing you to store and manipulate data
effectively. They serve as the foundation for implementing various algorithms and solving problems
efficiently.
</li>
<listyle="display: block !important; color: aqua; padding-bottom: 10px;"><span
style="color: chartreuse !important; font-style: italic; font-family: cursive;">Standard Library and
Third-Party Modules:</span> Python's standard
library includes numerous modules that offer a wide range of functionalities. Many of these modules are
relevant to DSA, providing implementations of common algorithms and data structures. For example, the
"collections" module offers advanced data structures like deque and OrderedDict. Additionally, there are
several popular third-party libraries, such as NumPy, Pandas, and SciPy, which provide powerful tools for
numerical computing, data manipulation, and scientific computing.
</li>
<listyle="display: block !important; color: aqua; padding-bottom: 10px;"><span
style="color: chartreuse !important; font-style: italic; font-family: cursive;">Algorithmic
Implementations:</span> Python's flexibility allows for
easy implementation of algorithms. It supports imperative, functional, and object-oriented programming
paradigms, providing developers with various approaches to solving algorithmic problems. Additionally,
Python's dynamic typing and high-level abstractions allow for rapid prototyping and experimentation, enabling
programmers to iterate quickly on algorithmic solutions.
</li>
<listyle="display: block !important; color: aqua; padding-bottom: 10px;"><span
style="color: chartreuse !important; font-style: italic; font-family: cursive;">Pythonic Idioms:</span>
Pythonic idioms refer to programming
practices and patterns specific to Python. These idioms emphasize code clarity and readability while
leveraging the language's unique features. By following Pythonic idioms, DSA implementations become more
elegant and concise. For instance, list comprehensions, generators, and context managers are common Pythonic
constructs that can simplify code related to algorithms and data structures.
</li>
<listyle="display: block !important; color: aqua; padding-bottom: 10px;"><span
style="color: chartreuse !important; font-style: italic; font-family: cursive;">Testing and
Debugging:</span> Python offers robust testing
frameworks, such as unittest and pytest, which aid in the development and verification of DSA implementations.
These frameworks allow you to write test cases, automate test execution, and easily identify and fix issues.
Python's debugging capabilities, with tools like pdb (Python Debugger), help diagnose and resolve problems
efficiently.
</li>
</ol>
</p>
<pclass="p" style="color: aqua !important">
Overall, Python's combination of simplicity, readability, powerful libraries, and vast community support makes
it an excellent choice for implementing data structures and algorithms. Its ecosystem provides ample resources,
tutorials, and documentation to support learning and mastering DSA using Python.
</p>
<hrclass="one" />
<h1class="story">First Python Program</h1>
<hrclass="two" />
<divclass="container main-body-2">
<preclass="left-2">
<codeid="code-block" class="python">
print("Hello, World!")
</code>
</pre>
<buttonclass="copy-button right-2" onclick="copyCode()">Copy Code</button>
</div>
<divid="notification" class="notification"></div>
<hrclass="one" />
<h1class="h1">
Variables In Python
</h1>
<hrclass="two" />
<pclass="p" style="color: aqua !important">Variables are the name , given to a particular memory location. We've
to follow some rule to declare a variable names in Python . Those are :-</p>
<h1class="story">Do This</h1>
<spanclass="do" style="color: chartreuse; font-family: cursive; font-size: 20px; padding-left: 100px;">1) Starts
with only A-Z / a-z/ _ .</span>
<br/>
<spanclass="do" style="color: chartreuse; font-family: cursive; font-size: 20px; padding-left: 100px;">2) Can
contain number in the middle.</span>
<h1class="story">Don't Do This</h1>
<spanclass="do" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">1) Doesn't
starts with any number (0-9).</span>
<br/>
<spanclass="do" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">2) Some
system variables starts with (_) , so we'll avoid that.</span>
<pclass="p">As Python is a Dynamically Typed programming language , we don't need to mention the data type of the
variable . This will automatically detect that .</p>
<hrclass="one" />
<h1class="h1">
Data Types In Python
</h1>
<hrclass="two" />
<pclass="p">We've some by default data-types in Python like,-</p>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">1)
Integer</span>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">2)
Float</span>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">3)
Strings</span>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">4)
Arrays</span>
<pclass="p">To know a data-type of a variable , we can use <spanstyle="color: greenyellow;">type()</span>
function .</p>
<hrclass="one" />
<h1class="h1">Arithmetical Operators</h1>
<hrclass="two" />
<pclass="p">In Python we've some Arithmetical Operators ,-</p>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">1)
<bstyle="color: chartreuse;">[+]</b>
To add two integers / floats / strings</span>
<br/>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">1)
<bstyle="color: chartreuse;">[-]</b>
To subtract two integers / floats</span>
<br/>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">1)
<bstyle="color: chartreuse;">[*]</b>
To multiply two integers / floats</span>
<br/>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">1)
<bstyle="color: chartreuse;">[/]</b>
To divide two integers / floats</span>
<br/>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">1)
<bstyle="color: chartreuse;">[**]</b>
To power two integers / floats</span>
<br/>
<spanclass="dos" style="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px;">1)
<bstyle="color: chartreuse;">[//]</b>
To floor division two integers / floats</span>
<hrclass="one" />
<h1class="h1">Taking Inputs</h1>
<hrclass="two" />
<pclass="p">We've to use <spanstyle="color: chartreuse;">input()</span> function to take inputs , from the users
. By default the <spanstyle="color: chartreuse;">input()</span> function stores the user input in string
data-type format .</p>
<divclass="container main-body-2">
<preclass="left-2">
<codeid="code-block" class="python">
def add():
input1 = input("Enter Your first Number : ")
input2 = input("Enter Your second Number : ")
output = input1 + input2
print("The result is " + output)
add()
</code>
</pre>
</div>
<hrclass="two" />
<pclass="p">This code will store your numbers as string data-type , so it will not add your numbers . But if you
want to add them , you've to convert the data-type to string(str) to integer(int) . Let see how we can do that,-
</p>
<divclass="container main-body-2">
<preclass="left-2">
<codeid="code-block" class="python">
def add():
input1 = int(input("Enter Your first Number : "))
input2 = int(input("Enter Your second Number : "))
output = input1 + input2
print("The result is " + output)
add()
</code>
</pre>
</div>
<center>
<divid="box">
<astyle="color: chartreuse;" href="../lesson-2/quiz.html"><span>Take Quiz</span></a>
</div>
</center>
</div>
</div>
<footerclass="footer">
Copyright © 2023 || Developed By ::
<ahref="https://explorecode.newsgoogle.org"><spanclass="footer-code">Code Explorer</span></a>
</footer>
<scriptsrc="script.js"></script>
<scriptsrc="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/prism.min.js"></script>
</body>
</html>