QUESTION IMAGE
Question
in the program below, which two variables have the same scope? def subtract(numa, numb): return numa - numb def divide(numc, numd): return numc / numd answer = divide(24,6) print (answer)
Brief Explanations
In Python, variables defined within a function have local scope limited to that function. numA and numB are local to the subtract function, and numC and numD are local to the divide function. So numC and numD have the same scope as they are in the same function - divide.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
numC and numD