Local and Global Scope in Python | Local and Global Variables | Python Tutorial for Beginners #7

preview_player
Показать описание
Local and Global Scope in Python determine Local and Global Variables in Python. In this video, we discuss local and global scope in a python program and write multiple python program to understand the different scope in python program. We also check out the five things you need to remember when working with local and global variables in python.

This is the seventh video in the series of python tutorial for beginners. This video is focused on understanding the different scope in a python program. We see how to identify a local scope and a global scope and then see how to create a local and global variable in python.

Python supports both local and global variables but there are certain rules to follow when working with local and global variables. Important things to note are:
1. Local variables cannot be accessed in global scope.
2. Local variables cannot be accessed from other local scope.
3. Global variables can be accessed by any local scope.
4. Local and Global variables can share the same name.
5. Global variables can be modified inside a local scope using the “global” keyword.

This video is aimed at complete beginners who are just getting started with programming or with python programming. The concepts are explaining in the most basic manner so anyone can understand it.

The purpose of this Python tutorial series for beginners is to explain python programming in the most simplest manner by providing simple examples and working out interesting and meaningful python programs which should be a better way to learn programming especially for the beginners.

So please make sure to check that out as well.

Other video’s in this tutorial series:

What is a FUNCTION in Python | Python Functions | Python Tutorial for Beginners #6

Import modules in Python | Import module from different directory | Python Tutorial for Beginners #5

WHILE loop and FOR loop in Python | LOOP statements in Python | Python Tutorial for Beginners #4

IF ELSE ELIF statement in Python | IF ELSE Statement in Python | Python Tutorial for Beginners #3

What is a VARIABLE in Python | Python Variables | Python Tutorial for Beginners #2

What are DATA TYPE, OPERATORS and EXPRESSION in Python | Python Tutorial for Absolute Beginners #1

Please like, subscribe and leave a comment if you found the video to be useful. Also please make sure to click on the notification bell to be notified of my latest video’s.

🔴 WATCH MORE VIDEOS HERE 👇

✅ SQL Tutorial - Basic concepts:

✅ SQL Tutorial - Intermediate concepts:

✅ SQL Tutorial - Advance concepts:

✅ Practice Solving Basic SQL Queries:

✅ Practice Solving Intermediate SQL Queries:

✅ Practice Solving Complex SQL Queries:

✅ Data Analytics Career guidance:

✅ SQL Course, SQL Training Platform Recommendations:

✅ Python Tutorial:

✅ Git and GitHub Tutorial:

✅ Data Analytics Projects:

THANK YOU,
Thoufiq
Рекомендации по теме
Комментарии
Автор

You are an amazingggg creator. Your determination to help others, clarity, understanding & explaining. Everything is just fabbb. Keep doing your great work. God bless you😍

fathimafarahna
Автор

Thank you sir for smoothly explaining this topic with examples.

JBA
Автор

Your Explanation, kind of presentation it's really good and in a great way.There is more to go May you get blissful success ahead.

ayeshamohammad
Автор

Great content . Appreciate it !! I have one query. You earlier said that local variable cant be accessed from other local scope. But at 9:16, we are accessing local variables (which are defined in other local scope) in test3. Could you please throw some light on this ? Am I missing anything ? We can access the function, but local variable from other local scope ?

off
Автор

Hello @techTFQ! You're awesome.
Can you share a video on multithreading, pls ?

kbalanandam
Автор

why are we getting local test 3 first rather than local test1 local test2

pasumarthiashik