what is the output of the following code?
def spam():
    global eggs
    eggs='spam'
    def bacon():
        eggs='bacon'
        def ham():
            print(eggs)


eggs = 42
spam()
print(eggs))

Posted on by