Lecture 8 : OOPS in Python | Object Oriented Programming | Classes & Objects | Python Full Course

preview_player
Показать описание
This lecture was made with a lot of love❤️

Рекомендации по теме
Комментарии
Автор

34:50 Here's a simple and easy code:
class Student:
def __init__(self, name, marks1, marks2, marks3):
self.name=name
self.marks1=marks1
self.marks2=marks2
self.marks3=marks3

def print_average(self):

total_marks= self.marks1 +self.marks2 +self.marks3
average_marks= total_marks / 3
print("The average marks is:", average_marks)

s1=Student("Hasan", 70, 80, 87)
s1.print_average()

AhmadJutt
Автор

35:24 i think all students should try this code for better uderstanding

class student:
def __init__(self, name, marks1, marks2, marks3):
self.name = name
self.marks1 = marks1
self.marks2 = marks2
self.marks3 = marks3

def calc_average(self):
sum = self.marks1 +self.marks2 + self.marks3
get_avg = sum/3
return get_avg
obj = student("Aditya", 99, 98, 97)
print("hello", obj.name, "your avg marks is ", obj.calc_average())

adityadas
Автор

Introduction - 00:00
00:38 - Intro to oops
05:51 - Class & objects
11:48 - Constructors
23:05 - Class & instances attributes
29:36 - Methods
33:33 - Revision
34:43 - Let's practice
38:46 - Static methods
42:08 - Abstraction & encapsulation
49:00 - Let's practice
56:15 - outro(Next lecture info)

gd
Автор

Just started watching your videos and fell in love with the way of teaching ...You look like a student but explanation is amazing

nareshkatla
Автор

Didi aap itne acche se padhate ho
Ek baar main sab kuch clear ho jata hai ❤❤

CrazyManbypuspendra
Автор

You teach better than my College Teacher so please serve good things among future generation. Thank you.



Your Student.

FunTeenDev
Автор

Thanks a lot to Apna college for delivering such a valuable series and that to in very concise manner.

gt_shades
Автор

35.16
class Student:
def __init__(self, name, marks):
self.name = name
self.marks = marks

def get_avg(self):
return

s1 = Student("Himanshu", [45, 89, 98])
print("Hi student, ", s1.name, "your avg score is ", s1.get_avg())

joshia_himanshu
Автор

00:01 Introduction to Object Oriented Programming in Python
02:35 Moving from procedural to functional programming and the importance of objects and classes
06:53 Using classes and objects for practical storage of student information
08:43 Creating objects and instances in Python
13:32 Understanding the role of the constructor in Python OOPS
15:39 Understanding the usage of self and constructor in Python OOPS
19:19 Attributes are the data stored inside the class and object
21:05 Understanding Python constructors and classes
24:51 Self is a reference to the object and instance attributes differ for each object
26:41 Defining and accessing class attributes in Python
30:45 Methods are created for classes and used for objects.
32:43 Creating and using methods and constructors in Python classes
37:02 Understanding methods in Python classes
39:32 Static methods in Python do not have a 'self' parameter and work at the class level.
43:20 Abstraction in OOP hides unnecessary details, shows only essential things.
45:21 Understanding the sequence to start a car in OOPS in Python
49:27 Creating an Account class with balance and account number
51:58 Understanding debit and credit methods in Python OOP
56:20 Covered concepts like inheritance, polymorphism, and private entities

premsharma
Автор

Thank you this awesome video.
I believe that if we define two constructors (__init__ methods) in a single class, we will encounter an error because Python does not support method overloading. In this case, Python will only recognize the last defined constructor and will raise an error if the parameters do not match.

Saroj-jyh
Автор

the way you explain op i watch many video to understand init and static method you explaination is best

Krishna-ezxy
Автор

Earlier I used to think that "opp" is very difficult but your video has cleared my misconception 😊

arshzeelani
Автор

I needed this video ❤.. Thank you so much ma'am❤ .. Means a lot 💕🙏🏻🥺

udaygawande
Автор

Thankyou Shraddha Didi for making OOPS easy to understand.

jasmeetsinghbagga
Автор

54:00

class Account:
def __init__(self, account_no, balance):
self.account_no=account_no
self.balance=balance

def debit(self, amount):
if amount > self.balance:
print("isufficient balance")
else:
self.balance = self.balance - amount
print(f"Amount {amount} debited, new balance:", self.balance)

def credit(self, amount):

print(f"amount {amount} credited, new balance:", self.balance)

def get_balance(self):
print("balance:", self.balance)


s1=Account(123, 10)
s1.debit(5)
s1.credit(100)
s1.get_balance()

akhileshghatate
Автор

I learned a lot from this course Thanks .👍

saifulislamislam
Автор

MUJHE AJ ACHA SE PATA CHAL GAYA KI DIDI IRON MAN KA BOHAT BADA FAN HAI

chaplessgaming
Автор

Thanks for teaching you are a great teacher👌👌👌

salonikasera
Автор

class account:

def __init__(self, acc_no, bal):
self.acc = acc_no
self.bal = bal

def debit(self, amount):
self.bal -= amount
print("debited", amount)
print("Total balance =", self.get_balance())

def credit(self, amount):
self.bal += amount
print("credited", amount)
print("Total balance =", self.get_balance())

def get_balance(self):
return self.bal


a1 = account(int(input("account No :-")), int(input("account balance :-")))
print("Total balance :-", a1.bal)
print("Account No :-", a1.acc)
a1.debit(int(input("send to unknown acoount:-")))
a1.credit(int(input("recive from unknown acoount:-")))

banna_sandipsinh
Автор

35:24
class Avg:
def __init__(self, name, sub1, sub2, sub3):
self.name = name
self.sub1 = sub1
self.sub2 = sub2
self.sub3 = sub3

def average(self):


s1 = Avg("Om patil", 90, 90, 90)
s1.average()

jayshreeSonawane-yq