I have a small issue while calling multiple variables in python one function to another. Like I have to access the variable of xxx() variables in yyy(). Help me to do this.?
Try this:
def xxx():
a=10
b=15
c=20
return a, b
def yyy():
a, b = xxx()
print a
print b
yyy()
Or this:
def xxx():
global a, b
a=10
b=15
c=20
def yyy():
print a
print b
xxx()
yyy()
For more info, use help('return') and help('global'), or see this and this question.
And only use global when you need the variable can use at everywhere or you need the function return other things. Because modifying globals will breaks modularity.