KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Declaring a variable in a class (outside of a function): all class functions can access it (basically a public variable) Declaring a variable inside a function inside a class: only that function can access it (it's in that function's scope) Declaring a variable with self.(variable name) inside a function inside a class: all class functions can access it (how is this different from global (variable name) ?) And since there is no private/protected, everything is public, so everything accessible from inside a class is accessible from outside the class. Are there any other nuances I should know, or have I pretty much got it?
Tags (comma-separated)
Save Edits
Cancel