Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 916d396

Browse files
author
Amogh Singhal
authored
Update Python_Programming_Quiz.md
1 parent 44d1406 commit 916d396

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎Python_Programming_Quiz.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,14 @@ __First:__ This assigns 3, 4, and 5 to a, b, and c respectively <br>
239239
__Second:__ Ths assigns 3 to a, b, and c <br>
240240
`>>> a=b=c=3`<br>
241241

242-
#### 13. What is the `with` keyword in Python?
242+
#### 14. What is the `with` keyword in Python?
243243
The `with` statement in Python ensures that cleanup code is executed when working with unmanaged resources by encapsulating common preparation and cleanup tasks. <br>
244244
- It may be used to open a file, do something, and then __automatically close the file at the end.__
245245
- It may be used to open a database connection, do some processing, then __automatically close the connection to ensure resources are closed and available for others__.
246246

247247
`with` will __cleanup the resources even if an exception is thrown__
248+
249+
#### 15. What is the `PYTHONPATH` variable?
250+
`PYTHONPATH` is the variable that tells the __interpreter where to locate the module files imported into a program__.<br>
251+
Hence, it must include the Python source library directory and the directories containing Python source code. <br>
252+
You can manually set PYTHONPATH, but usually, the Python installer will preset it.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /