Q:

Write a Python program to detect the number of local variables declared in a function

0

Write a Python program to detect the number of local variables declared in a function.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def abc():
    x = 1
    y = 2
    str1= "w3resource"
    print("Python Exercises")

print(abc.__code__.co_nlocals)

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now