Where does "object" come from in Python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Where does "object" come from in Python?

I do not know where this object comes from. It happens in line 1 of Python. 1 |class ClassName(object): <= this 2 | # Python code here

2nd Sep 2018, 4:32 PM
program
program - avatar
3 Answers
+ 5
it should be, class childClass(parentClass) : #code here now child class is derived from or inherited from parentClass.
2nd Sep 2018, 5:20 PM
code learner
code learner - avatar
+ 4
class A(object): pass class B: pass print(A.__bases__) print(B.__bases__) # https://stackoverflow.com/questions/4015417/JUMP_LINK__&&__python__&&__JUMP_LINK-class-inherits-object
2nd Sep 2018, 9:57 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 1
You need to create the object of the class and use it. like this. x=ClassName(properties) print(x.propertyname) Here x is the object of the class. whose Name is ClassName
2nd Sep 2018, 4:41 PM
Maninder $ingh
Maninder $ingh - avatar