r/PythonProjects2 • • Oct 23 '25

Python daily challenge

Post image

🧠 Think you're a Python pro? This sneaky list mutation trick has tripped up even experts – what's the output of nums and result? Drop your pick (A/B/C/D) below and see if you spot the gotcha! 🐍 #PythonQuiz #CodingChallenge

18 Upvotes

22 comments sorted by

View all comments

6

u/asmodeus0000 Oct 24 '25
def outer(fn):
    def inner():
        print("Before")
        fn()
        print("After")

    return inner

@outer
def greet():
    print("Hello!")

greet()

I hope this is what OP meant to write, but couldn't get all 2 of his brain cells to co-operate

2

u/TroPixens Oct 24 '25

There’s a error as An answer

3

u/asmodeus0000 Oct 24 '25

the OPs code isnt gonna give an error answer of OPs code is (E) Nothing