{"id":1491,"date":"2023-05-21T08:28:15","date_gmt":"2023-05-21T08:28:15","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.com\/?p=1491"},"modified":"2023-05-21T08:28:15","modified_gmt":"2023-05-21T08:28:15","slug":"give-an-example-of-a-class-in-python","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2023\/05\/21\/give-an-example-of-a-class-in-python\/","title":{"rendered":"Give an example of a class in Python"},"content":{"rendered":"\n<p>Example of class in Python<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\t\t# Example file for working with classes\nclass myClass():\n  def method1(self):\n      print(\"Guru99\")\n         \n  def method2(self,someString):    \n      print(\"Software Testing:\" + someString)\n   \n   def main():           \n  # exercise the class methods\n  c = myClass ()\n  c.method1()\n  c.method2(\" Testing is fun\")\n   \nif __name__== \"__main__\":\n  main() <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Example of class in Python # Example file for working with classes class myClass(): def&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1491"}],"collection":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/comments?post=1491"}],"version-history":[{"count":1,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1491\/revisions"}],"predecessor-version":[{"id":1492,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1491\/revisions\/1492"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=1491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=1491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=1491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}