+ 1
[Python] What is the difference between an object and an instance?
I'm still a bit confused on that.
5 Answers
+ 4
I got this analogy from code academy but hopefully it helps.
A blueprint for a house design is like a class description. All the houses built from that blueprint are objects of that class. A given house is an instance.
+ 3
Instance of a class is called as an object.
Both same..
+ 2
Thank you for the answers!
+ 2
Thanks, Geoffrey!
+ 1
Object = Instance of a Class
So yes an instance is an object.
If you want to know who is the parent Class of an object you can use
print( type( myVar ) )
For example:
print(type(5))
output: int
Some more informations: https://www.google.com/amp/s/www.geeksforgeeks.org/type-isinstance-JUMP_LINK__&&__python__&&__JUMP_LINK/amp/