KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What is the difference between class and instance variables in Python? class Complex: a = 1 and class Complex: def __init__(self): self.a = 1 Using the call: x = Complex().a in both cases assigns x to 1. A more in-depth answer about __init__() and self will be appreciated.
Tags (comma-separated)
Save Edits
Cancel