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)