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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!