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 »
Now we can use the class named myClass to create objects:
Create an object named p1, and print the value of x:
p1 = MyClass()
print(p1.x)
Try it Yourself »
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
help@w3schools.com
Your message has been sent to W3Schools.