Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

in the program below, which two variables have the same scope? def subt…

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)

Explanation:

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.

Answer:

numC and numD