-
Notifications
You must be signed in to change notification settings - Fork 0
/
python.html
754 lines (663 loc) · 40.4 KB
/
python.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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Get FAQ</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;600;700&display=swap">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/6.4.8/swiper-bundle.min.css"/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<section class="Sub-header">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container">
<a href="index.html" class="logo">
<img src="img/logo.svg" alt="logo" />
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="nav-links" id="navLinks">
<ul>
<li><a href="index.html" class="btn btn btn-secondary ">Home</a></li>
<li>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle btn" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
LANGUAGES
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="python.html">Python</a>
<a class="dropdown-item" href="c++.html">C++</a>
<a class="dropdown-item" href="java.html">Java</a>
<a class="dropdown-item" href="javascript.html">Data Structure</a>
<a class="dropdown-item" href="OS.html">Operating System</a>
<a class="dropdown-item" href="sql.html">SQL</a>
</div>
</div>
</li>
<li><a href="about copy.html" class="btn btn btn-secondary ">About Us</a></li>
<li><a href="contact.html" class="btn btn btn-secondary ">Contact Us</a></li>
</ul>
</div>
</div>
</nav>
<div class="inner_text">
<h1>PYTHON</h1>
</div>
</section>
<!-- course start -->
<section class="course">
<h1>QUESTIONS BASED ON PYTHON LANGUAGE</h1>
<div class= "faq">
<div class = "question">
<h4>What is a dynamically typed language? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Before we understand a dynamically typed language, we should learn about what typing is. Typing refers to type-checking in programming languages. In a strongly-typed language, such as Python, "1" + 2 will result in a type error since these languages don't allow for "type-coercion".
<br>Type-checking can be done at two stages:
<br> • Static - Data Types are checked before execution.
<br> • Dynamic - Data Types are checked during execution.
Python is an interpreted language, executes each statement line by line and thus type-checking is done on the fly, during execution. Hence, Python is a Dynamically Typed Language.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is an Interpreted language?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
An Interpreted language executes its statements line by line. Languages such as Python, Javascript, R, PHP, and Ruby are prime examples of Interpreted languages. Programs written in an interpreted language runs directly from the source code, with no intermediary compilation step.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Define Pass statement in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A Pass statement in Python is used when we cannot decide what to do in our code, but we must type something for making syntactically correct.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Do runtime errors exist in Python? Give an example?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Yes, runtime errors exist in Python. For example, if you are duck typing and things look like a duck, then it is considered as a duck even if that is just a flag or stamp or any other thing. The code, in this case, would be A Run-time error. For example, Print “Hackr io”, then the runtime error would be the missing parenthesis that is required by print ( ).
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4> Does Python support an intrinsic do-while loop or not? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
No Python does not support an intrinsic do-while loop.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Why do we need membership operators in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
We need membership operators in Python with the purpose to confirm if the value is a member in another or not.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What do you understand by the process of compilation and linking in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
In order to compile new extensions without any error, compiling and linking is used in Python. Linking initiates only and only when the compilation is complete.
In the case of dynamic loading, the process of compilation and linking depends on the style that is provided with the concerned system. In order to provide dynamic loading of the configuration setup files and rebuilding the interpreter, the Python interpreter is used.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is Pickling and Unpickling in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The Pickle module in Python allows accepting any object and then converting it into a string representation. It then dumps the same into a file by means of the dump function. This process is known as pickling.
The reverse process of pickling is known as unpickling i.e. retrieving original Python objects from a stored string representation.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Whenever Python exits, all the memory isn’t deallocated. Why is it so? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Upon exiting, Python’s built-in effective cleanup mechanism comes into play and try to deallocate or destroy every other object.
However, Python modules that are having circular references to other objects or the objects that are referenced from the global namespaces aren’t always deallocated or destroyed.
This is because it is not possible to deallocate those portions of the memory that are reserved by the C library.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How are arguments passed in Python? By value or by reference?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
All of the Python is an object and all variables hold references to the object. The reference values are according to the functions; as a result, the value of the reference cannot be changed.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Define slicing in Python.</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Slicing refers to the mechanism to select the range of items from sequence types like lists, tuples, strings.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What are docstring?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Docstring is a Python documentation string, it is a way of documenting Python functions, classes and modules.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What are decorators in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Decorators are used to add some design patterns to a function without changing its structure. Decorators generally are defined before the function they are enhancing. To apply a decorator we first define the decorator function. Then we write the function it is applied to and simply add the decorator function above the function it has to be applied to. For this, we use the @ symbol before the decorator.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is slicing in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Slicing is used to access parts of sequences like lists, tuples, and strings. The syntax of slicing is-[start:end:step]. The step can be omitted as well. When we write [start:end] this returns all the elements of the sequence from the start (inclusive) till the end-1 element. If the start or end element is negative i, it means the ith element from the end. The step indicates the jump or how many elements have to be skipped. Eg. if there is a list- [1,2,3,4,5,6,7,8]. Then [-1:2:2] will return elements starting from the last element till the third element by printing every second element.i.e. [8,6,4].
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What are Literals in Python and explain about different Literals?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A literal in python source code represents a fixed value for primitive data types.
<br>There are 4 types of literals in python-
<br>• String literals– A string literal is created by assigning some text enclosed in single or double quotes to a variable. To create multiline literals, assign the multiline text enclosed in triple quotes. Eg.name="Tanya"
<br>• A character literals– It is created by assigning a single character enclosed in double quotes. Eg. a='T'
<br>• Numeric literals– They include numeric values that can be either integer, floating point value, or a complex number. Eg. a=50
<br>• Boolean literals– These can be 2 values- either True or False.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How to combine dataframes in pandas?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The dataframes in python can be combined in the following ways-
<br>• Concatenating them by stacking the 2 dataframes vertically.
<br>• Concatenating them by stacking the 2 dataframes horizontally.
<br>• Combining them on a common column. This is referred to as joining.
The concat() function is used to concatenate two dataframes. Its syntax is- pd.concat([dataframe1, dataframe2]).
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What are the new features added in Python 3.9.0.0 version?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The new features in Python 3.9.0.0 version are-
<br>• New Dictionary functions Merge(|) and Update(|=)
<br>• New String Methods to Remove Prefixes and Suffixes
<br>• Type Hinting Generics in Standard Collections
<br>• New Parser based on PEG rather than LL1
<br>• New modules like zoneinfo and graphlib
<br>• Improved Modules like ast, asyncio, etc.
<br>• Removal of erroneous methods, functions, etc.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How is memory managed in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Memory is managed in Python in the following ways:
<br>• Memory management in python is managed by Python private heap space. All Python objects and data structures are located in a private heap. The programmer does not have access to this private heap. The python interpreter takes care of this instead.
<br>• The allocation of heap space for Python objects is done by Python’s memory manager. The core API gives access to some tools for the programmer to code.
<br>• Python also has an inbuilt garbage collector, which recycles all the unused memory and so that it can be made available to the heap space.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is namespace in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A namespace is a naming system used to make sure that names are unique to avoid naming conflicts.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is python function? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A function is a block of code which is executed only when it is called. To define a Python function, the def keyword is used.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4> What is __init__?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
__init__ is a method or constructor in Python. This method is automatically called to allocate memory when a new object/ instance of a class is created. All classes have the __init__ method. </p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Does python support multiple inheritance? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Multiple inheritance means that a class can be derived from more than one parent classes. Python does support multiple inheritance, unlike Java.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is Polymorphism in Python? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Polymorphism means the ability to take multiple forms. So, for instance, if the parent class has a method named ABC then the child class also can have a method with the same name ABC having its own parameters and variables. Python allows polymorphism.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Define encapsulation in Python? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Encapsulation means binding the code and the data together. A Python class in an example of encapsulation.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How do you do data abstraction in Python?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Data Abstraction is providing only the required details and hiding the implementation from the world. It can be achieved in Python by using interfaces and abstract classes.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Does python make use of access specifiers? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Python does not deprive access to an instance variable or function. Python lays down the concept of prefixing the name of the variable, function or method with a single or double underscore to imitate the behavior of protected and private access specifiers.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4> How to create an empty class in Python? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
An empty class is a class that does not have any code defined within its block. It can be created using the pass keyword. However, you can create objects of this class outside the class itself. IN PYTHON THE PASS command does nothing when its executed. it’s a null statement.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is PYTHONPATH? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
It is an environment variable which is used when a module is imported. Whenever a module is imported, PYTHONPATH is also looked up to check for the presence of the imported modules in various directories. The interpreter uses it to determine which module to load.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4> Is indentation required in python? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Indentation is necessary for Python. It specifies a block of code. All code within loops, classes, functions, etc is specified within an indented block. It is usually done using four space characters. If your code is not indented necessarily, it will not execute accurately and will throw errors as well.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Is Django better than Flask? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Django is more popular because it has plenty of functionality out of the box, making complicated applications easier to build. Django is best suited for larger projects with a lot of features. The features may be overkill for lesser applications.
If you’re new to web programming, Flask is a fantastic place to start. Many websites are built with Flask and receive a lot of traffic, although not as much as Django-based websites. If you want precise control, you should use flask, whereas a Django developer relies on a large community to produce unique websites.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How to merge dataframes in pandas? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Merging depends on the type and fields of different dataframes being merged. If data is having similar fields data is merged along axis 0 else they are merged along axis 1.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How to access the last five entries of a dataframe?</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
By using tail(5) function we can get the top five entries of a dataframe. By default df.tail() returns the top 5 rows. To get the last n rows df.tail(n) will be used.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What are comments and how can you add comments in Python? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
Comments in Python refer to a piece of text intended for information. It is especially relevant when more than one person works on a set of codes. It can be used to analyse code, leave feedback, and debug it. There are two types of comments which includes:
<br> • Single-line comment
<br> • Multiple-line comment
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4> What is a classifier? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
A classifier is used to predict the class of any data point. Classifiers are special hypotheses that are used to assign class labels to any particular data points. A classifier often uses training data to understand the relation between input variables and the class. Classification is a method used in supervised learning in Machine Learning.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>How do you get a list of all the keys in a dictionary? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
One of the ways we can get a list of keys is by using: dict.keys()
This method returns all the available keys in the dictionary.
<br> dict = {1:a, 2:b, 3:c} dict.keys()
o/p: [1, 2, 3]
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Explain Python List Comprehension </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
List comprehensions are used for transforming one list into another list. Elements can be conditionally included in the new list and each element can be transformed as needed. It consists of an expression leading a for clause, enclosed in brackets.
<br> for ex: list = [i for i in range(1000)]
print list
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the bytes() function? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The bytes() function returns a bytes object. It is used to convert objects into bytes objects, or create empty bytes object of the specified size.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the ‘with statement’? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
“with” statement in python is used in exception handling. A file can be opened and closed while executing a block of code, containing the “with” statement, without using the close() function. It essentially makes the code much more easy to read.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>What is the difference between tuple and dictionary? </h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
One major difference between a tuple and a dictionary is that dictionary is mutable while a tuple is not. Meaning the content of a dictionary can be changed without changing it’s identity, but in tuple that’s not possible.
</p>
</div>
</div>
<div class= "faq">
<div class = "question">
<h4>Differentiate between new and override modifiers.</h4>
<svg width="15" height="10" viewbox = "0 0 42 25">
<path d="M3 3L21 21L39 3" stroke="white" stroke-width="7" stroke-linecap="round"/>
</svg>
</div>
<div class = "answer">
<p>
The new modifier is used to instruct the compiler to use the new implementation and not the base class function.
<br> The Override modifier is useful for overriding a base class function inside the child class.
</p>
</div>
</div>
</section>
<!-- course end -->
<!-- best course start -->
<section class="facilities">
<h1>Top 5 Things to Remember in an Interview</h1>
<p>You worked hard on your resume and job application, and now you are called in for an in-person job interview. You are one step closer to your dream job.
It’s time to understand how to succeed in the job interview, so that you can actually land the job. Here are the most important things you have to remember.</p>
<div class="row">
<div class="faq">
<h1>1. Dress appropriately</h1>
<h6>Plan out an outfit that fits the culture of the company you are applying for. If the company does not have a dress code, it’s a good idea to wear business casual.
Leave your shorts and tank top at home, and put on a shirt and a pair of long pants. It’s always better to be overdressed than under. Try on your outfit before the interview to make sure that it fits and looks smart.
</h6>
<h1>2. Arrive on time </h1>
<h6>Don’t ever arrive at a job interview late! It’s best to arrive 15 minutes before the scheduled time in case you have to fill in some paperwork. This also allows you to settle down and check out the dynamics of the office.
If you are not familiar with the area in which the company is located, do a test run a week or two before to make sure that you won’t get lost. If you are driving, make a note on where you can park your car.
</h6>
<h1>3. Mind your manner</h1>
<h6>Be polite and greet everyone you meet, including people you meet in the elevator. When you enter the interview, offer the interviewer a warm greeting. These first few seconds can make or break your interview. At the end of the interview, don’t forget to thank the interviewer for giving you the opportunity for the meeting. When you leave the company, say goodbye to the receptionist.
</h6>
<h1>4. Pay attention to your body language<h1>
<h6> Poor body language, such as playing with a pen, chewing gum, slouching, and even brushing back hair, can be a distraction. If you notice you have a tendency to do any of these, train yourself to avoid these bad habits. You can replace them with positive body language that include nodding, eye contact, smiling, and solid posture.
</h6>
<h1>5. Ask insightful questions</h1>
<h6>Most interviewers end an interview by allowing the candidate to ask questions. Regardless of how well you know the company and how thorough the interviewer in telling you about the job, you must ask a few questions. The more insightful your questions are, the more you will impress your interviewer.
What do you do in an interview? Let us know in the comments below!
</h6>
</div>
</div>
<!-- Footer start -->
<section class="footer">
<hr>
<a href="about copy.html" class="foot_btn">ABOUT US</a>
<a href="contact.html" class="foot_btn">CONTACT US</a>
<div class="icons">
<i class="fab fa-facebook-f"></i>
<i class="fab fa-instagram"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-linkedin"></i>
</div>
<p>Made with <i class="fas fa-heart"></i> by Shruti </p>
<p>Copyright © 2022 <a href="index.html">Get FAQ</a>. All Rights Reserved.</p>
</section>
<!-- Footer end -->
<script src="script.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script>
</body>
</html>