Variable Scope : Python tutorial 81

preview_player
Показать описание
Guys please help this channel to reach 20,000 subscribers. I'll keep uploading quality content for you.

Python is easy programming language to learn and anyone can learn it, and these tutorials are 100% free in hindi.

You can share this playlist with your brother, sisters and friends. This will surely add some values to their life.

If you follow this complete playlist of python tutorial surely you will learn everything about python programming language.

This video is all about "variable scope"

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

A- one teaching technique ...
Thank u so much sir for ur efforts

AstroEngieering
Автор

Bro for this topic I watched atleast 5 video none of them went into my head u made it so simple and easy 🙏👏

__yogesh__
Автор

Thank you brother.
Your python training is great

Mandalvivek
Автор

I actually like your way of explaining the things

stark
Автор

Broo chapter 4th ka summary videos please and thanks for the teaching and support

un
Автор

x=12
def f1(a=x):
return a
x=15

print(f1())


** Answer= 12

mdroisislam
Автор

**SOURCE CODE**

#default parameters
def user_info(first_name, last_name, age=24):
print(f"Your first name is {first_name}")
print(f"Your last name is {last_name}")
print(f"Your age is {age}")

user_info("Harshit", "Vaishistha") #Your first name is Harshit
#Your last name is Vaishistha
#Your age is 24

#default parameters
def user_info(first_name, last_name='unknown', age=None):
print(f"Your first name is {first_name}")
print(f"Your last name is {last_name}")
print(f"Your age is {age}")

user_info("Harshit", "Vaishistha") #Your first name is Harshit
#Your last name is Vaishistha
#Your age is None

#default parameters
def user_info(first_name, last_name='unknown', age):
print(f"Your first name is {first_name}")
print(f"Your last name is {last_name}")
print(f"Your age is {age}")

user_info("Harshit", 24) #error (non-default arguments can't follow default arguement)

#default parameters
def user_info(first_name, last_name='unknown', age):
print(f"Your first name is {first_name}")
print(f"Your last name is {last_name}")
print(f"Your age is {age}")

user_info("Harshit", "Vaishistha", 23) #error (non-default arguments can't follow default arguement)

#scope
def func():
x=7
return x
def func2():
print(x)

func2() #error

#scope
def func():
x=7
return x

print(x) #error

#scope
x=5 #global variable
def func():
x=7 #local variable
return x
print(func()) #7
print(x) #5

#scope
x=5 #global variable
def func():
global x
x=7 #local variable
return x
print(func()) #7
print(x) #7

#scope
x=5 #global variable
def func():
global x
x=7 #local variable
return x
print(x) #5
print(func()) #7
print(x) #7

beforetest
Автор

#please help brother in this question

consider input as three string :

Input:

Hello
Hi
Good Morning

Output:
H"ll" (# replace all vowels to " )
*i (# replace all consonant to * )
GOOD MORNING

herecodenestacademy
Автор

Brother did you made any tutorial on Java and c#

GurmeetSingh-uvqo
Автор

Sir agar mujhe terminal me apana code dekhna he to kya command type karo

narendrasoni
Автор

sir 239 se age ki vidos b bnay na you are the best teacher of python language

imranrasheed
Автор

Bro when I tried to open source code they said it is not available why

PBXGaming
Автор

Why you are not uploading any videothese days sir

techzwithsandesh
Автор

bro whenever i am writing the code the answer is coming but it ends with none plz tell me the solution of this problem plz

motorsyard
Автор

as we can bring the global variable by use of 'global'. So is there any way to bring local variable to global?

Santanu_Pal
Автор

bhai abi tum kya padre ho #harshit vashishtha

mohanbarman
Автор

x = 34
def fucn():
global x
x = 8
return x
print(fucn(x))
print(x)
sir error bata raha hai fucn() takes 0 positional arguments but 1 was given please thik karaya
🙏🙏🙏🙏🙏

mohammadirkanansari
Автор

hi this is Abhinay Shukla from Mumbai I am in fy of mca student
so I need to learn DATA STRUCTURE in PYTHON

shivamtiwarig
Автор

I want to print 1st non repeating charachter from a string... Can anyone plz help me out... I need it today

satyabratanayak