Python Create Object


Create Object

Now we can use the class named myClass to create objects:

Example

Create an object named p1, and print the value of x:

p1 = MyClass()
print(p1.x)
Try it Yourself »


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.