{"id":13389,"date":"2026-06-20T17:54:33","date_gmt":"2026-06-20T17:54:33","guid":{"rendered":"https:\/\/www.web-ai-institute.com\/wp\/2026\/06\/20\/49-python-tutorial-for-beginners-class-and-object\/"},"modified":"2026-06-20T17:54:33","modified_gmt":"2026-06-20T17:54:33","slug":"49-python-tutorial-for-beginners-class-and-object","status":"publish","type":"post","link":"https:\/\/www.web-ai-institute.com\/wp\/2026\/06\/20\/49-python-tutorial-for-beginners-class-and-object\/","title":{"rendered":"#49 Python Tutorial for Beginners | Class and Object"},"content":{"rendered":"<p><iframe loading=\"lazy\"  width=\"800\" height=\"400\" src=\"https:\/\/www.youtube.com\/embed\/8O5kX73OkIY\" frameborder=\"0\" allowfullscreen><\/iframe><br \/>\n<br \/>Check out our courses:<\/p>\n<p>Java Spring Boot AI Live Course: https:\/\/go.telusko.com\/JavaSpringBootAI<br \/>\nCoupon: TELUSKO20   (20% Discount)<\/p>\n<p>AI Powered DevOps with AWS &#8211; Live Course :-  https:\/\/go.telusko.com\/AIDevOps-AWS<br \/>\nCoupon: TELUSKO20   (20% Discount)<\/p>\n<p>Master Java Spring Development : https:\/\/go.telusko.com\/masterjava<br \/>\nCoupon: TELUSKO20   (20% Discount)<\/p>\n<p>For More Queries WhatsApp or Call on  :  +919008963671<\/p>\n<p>website : https:\/\/courses.telusko.com\/<\/p>\n<p>Udemy Courses:<\/p>\n<p>Spring: https:\/\/go.telusko.com\/udemyteluskospring<br \/>\nJava:- https:\/\/go.telusko.com\/udemyteluskojava<br \/>\nJava Spring:- https:\/\/go.telusko.com\/Udemyjavaspring<br \/>\nJava For Programmers:- https:\/\/go.telusko.com\/javaProgrammers<br \/>\nPython : https:\/\/go.telusko.com\/udemyteluskopython<br \/>\nGit : https:\/\/go.telusko.com\/udemyteluskogit<br \/>\nDocker : https:\/\/go.telusko.com\/udemyteluskodocker<\/p>\n<p>Instagram : https:\/\/www.instagram.com\/navinreddyofficial\/<br \/>\nLinkedin : https:\/\/in.linkedin.com\/in\/navinreddy20<br \/>\nTELUSKO Android App : https:\/\/go.telusko.com\/TELUSKOAPP<br \/>\nTELUSKO IOS App : https:\/\/apple.co\/3SsgmU2<br \/>\nDiscord : https:\/\/discord.gg\/D8hWe9BqfF<\/p>\n<p>In this lecture we will learn:<br \/>\n&#8211; Class and object in Python<br \/>\n&#8211; How are a class and an object created?<br \/>\n&#8211; Syntax for creating a class<br \/>\n&#8211; Syntax for creating an object<br \/>\n&#8211; How to call a method through an object?<br \/>\n&#8211; What is the type of an object?<\/p>\n<p>#1<br \/>\n&#8211; Class is a blueprint to create objects.<br \/>\n&#8211; Integer, Float, String, etc., are in-built types in Python.<br \/>\n&#8211; To create our type like a computer, we have to create our own class for it.<br \/>\n&#8211; To use the type that you have created, you need to define a class for it.<br \/>\n&#8211; A class can be defined by using the class keyword and every class must have a name to it.<\/p>\n<p>The syntax for creating a class:-<br \/>\n class class_name:<br \/>\n  methods():<br \/>\n   statements<br \/>\n  variables<\/p>\n<p>&#8211; A class consists of two things:<br \/>\n1. Attributes  &#8211; Variables<br \/>\n2. Behaviour &#8211; Methods (Functions)<\/p>\n<p>#2<br \/>\n&#8211; An object of a class can be defined by a  variable and assigned its value with the type of the class.<br \/>\n&#8211; A class can have multiple objects.<\/p>\n<p>Syntax of creating an object:-<br \/>\n object variable = class_name()<\/p>\n<p>#3<br \/>\n&#8211; type() return the type of a value that is present inside the variable.<br \/>\n&#8211; If we will return the type of an object, then it will print the class name. It means an object belongs to a type of particular class.<br \/>\n&#8211; String, integer, etc are also object that belongs to some in-build class like str and int respectively.<\/p>\n<p>#4<br \/>\n&#8211; We can call any method from a class.<br \/>\n&#8211; The behaviour of every object will be different from each other so need to define for which object, you are calling a method.<br \/>\n&#8211; So, we need to pass an object in it as a parameter at the time of calling a method.<br \/>\nThe syntax for calling a method:-<br \/>\n class_name.method_name(object variable)<\/p>\n<p>&#8211; We pass an object to a method as an argument that will go into the self.<br \/>\n&#8211; Self is the object that you are passing in a method.<br \/>\n&#8211; We can also call a method in another way:<br \/>\n object_variable.method_name()<\/p>\n<p>Python Tutorial to learn Python programming with examples<br \/>\nComplete Python Tutorial for Beginners Playlist : https:\/\/www.youtube.com\/watch?v=hEgO047GxaQ&#038;t=0s&#038;index=2&#038;list=PLsyeobzWxl7poL9JTVyndKe62ieoN-MZ3<br \/>\nPython Tutorial in Hindi : https:\/\/www.youtube.com\/watch?v=JNbup20svwU&#038;list=PLk_Jw3TebqxD7JYo0vnnFvVCEv5hON_ew<\/p>\n<p>Github :- https:\/\/github.com\/navinreddy20\/Python-<\/p>\n<p>Java and Spring Framework For beginners with Spring Boot : &#8211; http:\/\/bit.ly\/3LDMj8D<\/p>\n<p>Java Tutorial for Beginners (2023) :- http:\/\/bit.ly\/3yARVbN<\/p>\n<p>Editing Monitors :<br \/>\nhttps:\/\/amzn.to\/2RfKWgL<br \/>\nhttps:\/\/amzn.to\/2Q665JW<br \/>\nhttps:\/\/amzn.to\/2OUP21a.<\/p>\n<p>Subscribe to our other channel:<br \/>\nNavin Reddy : https:\/\/www.youtube.com\/channel\/UCxmk&#8230;<br \/>\nTelusko Hindi :<br \/>\nhttps:\/\/www.youtube.com\/channel\/UCitz&#8230;<\/p>\n<p>Donation:<br \/>\nPayPal Id : navinreddy20<br \/>\nPatreon : navinreddy20<br \/>\nhttp:\/\/www.telusko.com\/contactus<br \/>\n<br \/><a href=\"https:\/\/www.youtube.com\/watch?v=8O5kX73OkIY\">source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Check out our courses: Java Spring Boot AI Live Course: https:\/\/go.telusko.com\/JavaSpringBootAI Coupon: TELUSKO20 (20% Discount) AI Powered DevOps with AWS &#8211; Live Course :- https:\/\/go.telusko.com\/AIDevOps-AWS Coupon: TELUSKO20 (20% Discount) Master Java Spring Development : https:\/\/go.telusko.com\/masterjava Coupon: TELUSKO20 (20% Discount) For More Queries WhatsApp or Call on : +919008963671 website : https:\/\/courses.telusko.com\/ Udemy Courses: Spring: https:\/\/go.telusko.com\/udemyteluskospring&#8230;<\/p>\n","protected":false},"author":1,"featured_media":13390,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[317],"tags":[329,330,334,335,332,331,333],"class_list":["post-13389","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-intro-to-python-for-ai","tag-introduction-to-python-for-ai","tag-python-ai-agent-framework","tag-python-ai-code-generator","tag-python-ai-libraries","tag-python-ai-library-tutorial","tag-python-ai-tutorial"],"_links":{"self":[{"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/posts\/13389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/comments?post=13389"}],"version-history":[{"count":0,"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/posts\/13389\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/media\/13390"}],"wp:attachment":[{"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/media?parent=13389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/categories?post=13389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.web-ai-institute.com\/wp\/wp-json\/wp\/v2\/tags?post=13389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}