Question: how can i get this function to print properly and say i want a=2 and b=2 def get_total(a, b): #enclosed variable declared inside a function
how can i get this function to print properly and say i want a=2 and b=2
def get_total(a, b):
#enclosed variable declared inside a function
total = a + b
def double_it():
#local variable
double = total * 2
print(double)
double_it()
#double variable will not be accessible
print(double)
return total
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
