In this Python course video discussed the concept of scope in Python, which refers to the region of the code where a variable is defined and can be accessed. You can also learn about the LEGB (Local, Enclosing, Global, Built-in) rule, which specifies the order in which Python searches for a variable in different scopes.
Here are examples that demonstrated how the LEGB rule works in Python, including examples of local scope, enclosing scope, global scope, and built-in scope. Also an example of using the global keyword to modify a global variable inside a function, and an example of using the nonlocal keyword to access and modify a variable in the enclosing scope of a nested function.
NEXT VIDEO TO WATCH:
Will be available - 08.03.2023
TIMESTAMPS:
0:00 - Intro
0:45 - What are scopes in Python?
1:52 - What is local scope in Python
4:25 - What is enclosing scope in Python
6:08 - What is global scope in Python
9:10 - What is the built-in scope in Python
9:53 - Greate global and nonlocal variables inside the Python function
ABOUT MY CHANNEL
In my channel, you can find explainers and tutorials about programming and technology.
The topics are for different skills and levels, from beginners to professionals.
/ @explainit1024
Don’t forget to subscribe!
CHECK OUT OTHER VIDEOS ABOUT GIT:
• Learn GIT Basics in an hour!
CHECK OUT PYTHON TUTORIALS:
• Python tutorial for beginners 1. How to in...
On this page of the site you can watch the video online Python tutorial for beginners 13. Scopes with a duration of hours minute second in good quality, which was uploaded by the user ExplainIT 17 February 2023, share the link with friends and acquaintances, this video has already been watched 27 times on youtube and it was liked by 5 viewers. Enjoy your viewing!