38
38
< hr class ="two " />
39
39
< li >
40
40
< img src ="../images/arrow.png " alt ="" class ="arrow-img " />
41
- < a href ="https://youtube.com ">
41
+ < a href ="index.html ">
42
42
< span class ="lesson "> Lesson 2 / Revision</ span >
43
43
</ a >
44
44
</ li >
@@ -151,14 +151,15 @@ <h1 class="h1">
151
151
< hr class ="one " />
152
152
< h1 class ="h1 "> This Is A Quick Revision Of Python For This Course</ h1 >
153
153
< div class ="video-container ">
154
- < iframe width ="560 " height ="315 " src ="https://www.youtube.com/embed/RQKJB7z-OqU " title ="YouTube video player "
154
+ < iframe width ="560 " height ="315 " src ="https://www.youtube.com/embed/EaUnN9SZmy8 " title ="YouTube video player "
155
155
frameborder ="0 "
156
156
allow ="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share "
157
157
allowfullscreen > </ iframe >
158
158
</ div >
159
159
< center >
160
160
< div id ="box ">
161
- < span > Full PlayList</ span >
161
+ < a style ="color: chartreuse; " href ="https://www.youtube.com/watch?v=RQKJB7z-OqU&list=PLGxMeslbGNsU38f0599lOC-cRmrf01lD3&pp=iAQB "> < span > Full
162
+ PlayList</ span > </ a >
162
163
</ div >
163
164
</ center >
164
165
< hr class ="one " />
@@ -242,32 +243,12 @@ <h1 class="h1">This Is A Quick Revision Of Python For This Course</h1>
242
243
tutorials, and documentation to support learning and mastering DSA using Python.
243
244
</ p >
244
245
< hr class ="one " />
245
- < h1 class ="story "> Data Structures In Python</ h1 >
246
+ < h1 class ="story "> First Python Program </ h1 >
246
247
< hr class ="two " />
247
- <!-- <center>
248
- <p class="p" style="color: aqua !important">
249
- Now look at this picture very carefully...
250
- </p>
251
- </center>
252
- <div class="div-img">
253
- <img class="img" src="../images/dgm-2.png" alt="" />
254
- </div>
255
- <center>
256
- <p class="p" style="color: aqua !important">
257
- This is the solution for the problem...
258
- </p>
259
- </center>
260
- <div class="div-img">
261
- <img class="img" src="../images/dgm-3.png" alt="" />
262
- </div> -->
263
248
< div class ="container main-body-2 ">
264
249
< pre class ="left-2 ">
265
250
< code id ="code-block " class ="python ">
266
- # Your Python code here
267
- def greet():
268
251
print("Hello, World!")
269
-
270
- greet()
271
252
</ code >
272
253
</ pre >
273
254
@@ -278,48 +259,105 @@ <h1 class="story">Data Structures In Python</h1>
278
259
279
260
< hr class ="one " />
280
261
< h1 class ="h1 ">
281
- Some Very Popular Data Structures In Different Programming Languages
262
+ Variables In Python
282
263
</ h1 >
283
- < div id ="table ">
284
- < table >
285
- < thead >
286
- < th > Data Structure</ th >
287
- < th > Python</ th >
288
- < th > Java</ th >
289
- < th > C++</ th >
290
- </ thead >
291
- < tbody >
292
- < tr >
293
- < td > Array</ td >
294
- < td > Lists</ td >
295
- < td >
296
- Native Array
297
- < br />
298
- ArrayList
299
- </ td >
300
- < td >
301
- Native Array
302
- < br />
303
- std::vector
304
- </ td >
305
- </ tr >
306
- < tr >
307
- < td > Hash Table</ td >
308
- < td > Dictionary</ td >
309
- < td >
310
- HashMap < br />
311
- LinkedHashMap
312
- </ td >
313
- < td > std::map</ td >
314
- </ tr >
315
- < tr >
316
- < td > Linked List</ td >
317
- < td > Not Available</ td >
318
- < td > LinkedList</ td >
319
- < td > std::list</ td >
320
- </ tr >
321
- </ tbody >
322
- </ table >
264
+ < hr class ="two " />
265
+ < p class ="p " style ="color: aqua !important "> Variables are the name , given to a particular memory location. We've
266
+ to follow some rule to declare a variable names in Python . Those are :-</ p >
267
+ < h1 class ="story "> Do This</ h1 >
268
+ < span class ="do " style ="color: chartreuse; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1) Starts
269
+ with only A-Z / a-z/ _ .</ span >
270
+ < br />
271
+ < span class ="do " style ="color: chartreuse; font-family: cursive; font-size: 20px; padding-left: 100px; "> 2) Can
272
+ contain number in the middle.</ span >
273
+ < h1 class ="story "> Don't Do This</ h1 >
274
+ < span class ="do " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1) Doesn't
275
+ starts with any number (0-9).</ span >
276
+ < br />
277
+ < span class ="do " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 2) Some
278
+ system variables starts with (_) , so we'll avoid that.</ span >
279
+ < p class ="p "> As Python is a Dynamically Typed programming language , we don't need to mention the data type of the
280
+ variable . This will automatically detect that .</ p >
281
+ < hr class ="one " />
282
+ < h1 class ="h1 ">
283
+ Data Types In Python
284
+ </ h1 >
285
+ < hr class ="two " />
286
+ < p class ="p "> We've some by default data-types in Python like,-</ p >
287
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1)
288
+ Integer</ span >
289
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 2)
290
+ Float</ span >
291
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 3)
292
+ Strings</ span >
293
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 4)
294
+ Arrays</ span >
295
+ < p class ="p "> To know a data-type of a variable , we can use < span style ="color: greenyellow; "> type()</ span >
296
+ function .</ p >
297
+ < hr class ="one " />
298
+ < h1 class ="h1 "> Arithmetical Operators</ h1 >
299
+ < hr class ="two " />
300
+ < p class ="p "> In Python we've some Arithmetical Operators ,-</ p >
301
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1)
302
+ < b style ="color: chartreuse; "> [+]</ b >
303
+ To add two integers / floats / strings</ span >
304
+ < br />
305
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1)
306
+ < b style ="color: chartreuse; "> [-]</ b >
307
+ To subtract two integers / floats</ span >
308
+ < br />
309
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1)
310
+ < b style ="color: chartreuse; "> [*]</ b >
311
+ To multiply two integers / floats</ span >
312
+ < br />
313
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1)
314
+ < b style ="color: chartreuse; "> [/]</ b >
315
+ To divide two integers / floats</ span >
316
+ < br />
317
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1)
318
+ < b style ="color: chartreuse; "> [**]</ b >
319
+ To power two integers / floats</ span >
320
+ < br />
321
+ < span class ="dos " style ="color: #ff002b; font-family: cursive; font-size: 20px; padding-left: 100px; "> 1)
322
+ < b style ="color: chartreuse; "> [//]</ b >
323
+ To floor division two integers / floats</ span >
324
+ < hr class ="one " />
325
+ < h1 class ="h1 "> Taking Inputs</ h1 >
326
+ < hr class ="two " />
327
+ < p class ="p "> We've to use < span style ="color: chartreuse; "> input()</ span > function to take inputs , from the users
328
+ . By default the < span style ="color: chartreuse; "> input()</ span > function stores the user input in string
329
+ data-type format .</ p >
330
+ < div class ="container main-body-2 ">
331
+ < pre class ="left-2 ">
332
+ < code id ="code-block " class ="python ">
333
+ def add():
334
+ input1 = input("Enter Your first Number : ")
335
+ input2 = input("Enter Your second Number : ")
336
+
337
+ output = input1 + input2
338
+ print("The result is " + output)
339
+
340
+ add()
341
+ </ code >
342
+ </ pre >
343
+ </ div >
344
+ < hr class ="two " />
345
+ < p class ="p "> This code will store your numbers as string data-type , so it will not add your numbers . But if you
346
+ want to add them , you've to convert the data-type to string(str) to integer(int) . Let see how we can do that,-
347
+ </ p >
348
+ < div class ="container main-body-2 ">
349
+ < pre class ="left-2 ">
350
+ < code id ="code-block " class ="python ">
351
+ def add():
352
+ input1 = int(input("Enter Your first Number : "))
353
+ input2 = int(input("Enter Your second Number : "))
354
+
355
+ output = input1 + input2
356
+ print("The result is " + output)
357
+
358
+ add()
359
+ </ code >
360
+ </ pre >
323
361
</ div >
324
362
</ div >
325
363
</ div >
@@ -329,11 +367,6 @@ <h1 class="h1">
329
367
</ footer >
330
368
< script src ="script.js "> </ script >
331
369
< script src ="
https://cdn.jsdelivr.net/npm/[email protected] /prism.min.js "
> </ script >
332
- <!-- <script>
333
- // Initialize Prism.js
334
- Prism.highlightAll();
335
- </script> -->
336
-
337
370
</ body >
338
371
339
372
</ html >
0 commit comments