Share your repls and programming experiences

← Back to all posts
Code for Project
akuls (1)

Hello fellow repliters, I have been learning Python for five weeks and am still not very good at it. When I run this code, I get an error that the word 'denotation' is not defined when it actually is defined in the function titled 'word'. If you can help me, I would appreciate it a lot.

Voters
akuls (1)
Commentshotnewtop
ShivankChhaya (78)

I can help! If you define a variable in a function, that variable is considered local and can only be used inside that function. You have to define the variable outside of every class and function to make sure that everything in your program can use it. This is true for all programming languages.

akuls (1)

@ShivankChhaya Thank you so much for your help! I truly appreciate it.