logo

Crowdly

Una variable nonlocal fa referencia a que el seu ús dins una rutina no implica u...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Una variable nonlocal fa referencia a que el seu ús dins una rutina no implica un ús local, sinó que es tracta d'una variable definida en una rutina superior.

Exemple:

def fun():

    

x = "local"

    def subfun():

nonlocal x

        

x = "nonlocal"

         print("subfun:", x)

    subfun()

    print("fun:", x)

fun()

More questions like this

Want instant access to all verified answers on ad.uib.es?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!