Skip to content

Spoke Right

Education for everyone

https://spokeright.com
Primary Menu
  • Home
  • Our Services
    • Translation
    • Interpretation
    • Transcription
    • Voice-Over
    • Proofreading
    • Content writing
  • Free Education
    • Learn Android Studio
    • Learn Python
    • Learn MongoDB
    • Learn MySql
    • Learn React
    • Montessori Education
  • Spoke Right News
  • Earn Online
  • Classic Games by Spoke Right
    • TicTac
    • Checkers
    • Foosball
    • Billiards
    • Master Chess
    • Logic Game
  • Contact Us
Download Now
  • Home
  • Learn Python
  • What Is python object class
  • Learn Python

What Is python object class

Spoke Right December 5, 2022 1 min read

Python object class

Like Java and C++, Python is also based on OOPs Concept, i.e, Python is an object-oriented programming language which uses classes and objects for computations.

Python Class:

A collection of Objects is termed as Class in OOPs concept. Every class has its own unique and distinguishable attributes and methods.

Syntax:

class ClassName:

<statement-1> 

    . 

    . 

    . 

    <statement-N> 

 

Python Object:

Anything that has state and behavior can be termed as an Object, be it physical or logical. An Object is an entity mentioned in OOPs concept and is frequently found in Python codes.

Creating an object in Python is similar as calling a function. The objects attributes can then be accessed by using the object name prefix.

Example:

class Employees(): 
   def __init__(self, Name, Salary): 
       self.Name = Name
       self.Salary = Salary
 
   def details(self): 
       print "Employee Name : ", self.Name
       print "Employee Salary: ", self.Salary
       print "\n"
 
first = Employees("Khush", 10000) 
second = Employees("Raam", 20000)
third = Employees("Lav", 10000)
fourth = Employees("Sita", 30000)
fifth = Employees("Lucky", 50000)
 
first.details() 
second.details() 
third.details()
fourth.details()
fifth.details()

Continue Reading

Previous: How many OOPs concepts are there in Python
Next: what are Constructors in python

Related Stories

What is Data Statistics And Analysis With Java And Python
9 min read
  • Learn Python

What is Data Statistics And Analysis With Java And Python

December 7, 2022
How do I get the date in Python
2 min read
  • Learn Python

How do I get the date in Python

December 7, 2022
What is an exception handler in Python
2 min read
  • Learn Python

What is an exception handler in Python

December 7, 2022

This AD Will support Us

Support Us

Coding Ustad LTD Support
Coding Ustad LTD Support

Coding Ustad LTD

Coding Ustad LTD
Coding Ustad LTD

Recent Posts

  • How to Install Node.js and npm on CentOS 7
  • How to Install Node.js and npm on CentOS 7
  • How to Install CentOS Web Panel (CWP) on CentOS 7
  • The Power of Marketing in Real Estate: A Guide to Boost Your Business
  • Vehicle Verification in Pakistan

Get free Hosting

Hostens.com - A home for your website

You may have missed

How to Install Node.js and npm on CentOS 7
4 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install Node.js and npm on CentOS 7

May 3, 2023
How to Install Node.js and npm on CentOS 7
4 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install Node.js and npm on CentOS 7

May 2, 2023
How to Install CentOS Web Panel (CWP) on CentOS 7
3 min read
  • Coding Ustad LTD
  • Education for Everyone

How to Install CentOS Web Panel (CWP) on CentOS 7

May 2, 2023
The Power of Marketing in Real Estate: A Guide to Boost Your Business https://thaikadar.com/secureinvestment/
2 min read
  • Article By Spoke Right
  • Blog By Spoke Right
  • Circular Byte Private Limited

The Power of Marketing in Real Estate: A Guide to Boost Your Business

January 30, 2023
  • Home
  • Our Services
  • Free Education
  • Spoke Right News
  • Earn Online
  • Classic Games by Spoke Right
  • Contact Us
Copyright © All rights reserved. | MoreNews by AF themes.