What is the difference between a module-level variable and a class variable? #55
Answered
by
lukasmiller3
lukasmiller1
asked this question in
Q&A
-
|
What is the difference between a module-level variable and a class variable? |
Beta Was this translation helpful? Give feedback.
Answered by
lukasmiller3
Jan 22, 2026
Replies: 1 comment
-
|
A:Module-level variables are defined at the top level of a module and are global to that module. Class variables are defined within a class and are shared across all instances. Both can be accessed via ClassName.variable_name. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lukasmiller1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A:Module-level variables are defined at the top level of a module and are global to that module. Class variables are defined within a class and are shared across all instances. Both can be accessed via ClassName.variable_name.