You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-10Lines changed: 57 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,7 +197,7 @@ Stateful applications depend on the storage to save state and data, typically da
197
197
</b></details>
198
198
199
199
<details>
200
-
<summary>Describe the workflow of setting up some type of web server (Apache, IIS, Tomact, ...)</summary><br><b>
200
+
<summary>Describe the workflow of setting up some type of web server (Apache, IIS, Tomcat, ...)</summary><br><b>
201
201
</b></details>
202
202
203
203
<details>
@@ -3230,6 +3230,28 @@ Generally, every compiling process have a two steps.
3230
3230
3231
3231
<details>
3232
3232
<summary>Explain Exception Handling and how to use it in Python</summary><br><b>
3233
+
3234
+
**Exceptions:** Errors detected during execution are called Exceptions.
3235
+
3236
+
**Handling Exception:** When an error occurs, or exception as we call it, Python will normally stop and generate an error message.</br>
3237
+
Exceptions can be handled using `try` and `except` statement in python.
3238
+
3239
+
**Example:** Following example asks the user for input until a valid integer has been entered. </br>
3240
+
If user enter a non-integer value it will raise exception and using except it will catch that exception and ask the user to enter valid integer again.
3241
+
3242
+
3243
+
```py
3244
+
whileTrue:
3245
+
try:
3246
+
a =int(input("please enter an integer value: "))
3247
+
break
3248
+
exceptValueError:
3249
+
print("Ops! Please enter a valid integer value.")
3250
+
3251
+
```
3252
+
3253
+
For more details about errors and exceptions follow this [https://docs.python.org/3/tutorial/errors.html](https://docs.python.org/3/tutorial/errors.html)
3254
+
3233
3255
</b></details>
3234
3256
3235
3257
<details>
@@ -3247,14 +3269,35 @@ Generally, every compiling process have a two steps.
3247
3269
<details>
3248
3270
<summary>What is Lambda? How is it used?</summary><br><b>
3249
3271
3250
-
Lambda is an anonymous function is known as a lambda function. This function can have any number of parameters but, can have just one statement.
3272
+
A <code>lambda</code> expression is an 'anonymous' function, the differnce from a normal defined function using the keyword `def`` is the syntax and ussage.
3273
+
3274
+
The syntax is:
3251
3275
3252
-
Example:
3276
+
```lambda[parameters]: [expresion]```
3277
+
3278
+
**Examples:**
3279
+
3280
+
* A lambda function add 10 with any argument passed.
3281
+
3282
+
```py
3283
+
x =lambdaa: a +10
3284
+
print(x(10))
3285
+
```
3286
+
3287
+
* An addition function
3288
+
3289
+
```py
3290
+
addition =lambdax, y: x + y
3291
+
print(addition(10, 20))
3253
3292
```
3254
-
1 a = lambda x,y : x+y
3255
-
2 print(a(5, 6))
3256
-
Output: 11
3293
+
3294
+
* Squaring function
3295
+
3296
+
```py
3297
+
square =lambdax : x **2
3298
+
print(square(5))
3257
3299
```
3300
+
Generally it is considered a bad practice under PEP 8 to asign a lambda expresion, they are meant to be used as parameters and inside of other defined functions.
3258
3301
3259
3302
</b></details>
3260
3303
@@ -3699,15 +3742,15 @@ Detailed answer can be found here: http://codingshell.com/python-all-string-perm
3699
3742
<details>
3700
3743
<summary>How to reverse a string? (e.g. pizza -> azzip)</summary><br><b>
3701
3744
3702
-
Shortest way is:
3745
+
The correct way is:
3703
3746
3704
3747
```
3705
3748
my_string[::-1]
3706
3749
```
3707
3750
3708
-
But it doesn't mean it's the most efficient one. <br>
<summary>What is the <code>.git</code> directory? What can you find there?</summary><br><b>
4450
+
The <code>.git</code> folder contains all the information that is necessary for your project in version control and all the information about commits, remote repository address, etc. All of them are present in this folder. It also contains a log that stores your commit history so that you can roll back to history.
4451
+
4452
+
4453
+
This info copied from [https://stackoverflow.com/questions/29217859/what-is-the-git-folder](https://stackoverflow.com/questions/29217859/what-is-the-git-folder)
4407
4454
</b></details>
4408
4455
4409
4456
<details>
4410
4457
<summary>What are some Git anti-patterns? Things that you shouldn't do</summary><br><b>
0 commit comments