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

  Рет қаралды 745,964

Shradha Khapra

Shradha Khapra

Күн бұрын

Пікірлер: 566
@gd14444
@gd14444 10 ай бұрын
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)
@shaikhfaisal8776
@shaikhfaisal8776 8 ай бұрын
Thank you 🙂
@ArpitSharma-s7k
@ArpitSharma-s7k 6 ай бұрын
@Ritesh.s
@Ritesh.s 5 ай бұрын
Actually it's not OOPS it is OOP. object oriented programming ❤
@FutureTookans
@FutureTookans 2 ай бұрын
❤❤
@makarsh29
@makarsh29 2 ай бұрын
thanks bhai
@Software204
@Software204 Ай бұрын
Qasm se college Mai itna clear nahii jitna apkii lecture se hota hai......big respect from Pakistan.....
@premsharma2595
@premsharma2595 5 ай бұрын
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
@AhmadJutt850
@AhmadJutt850 5 ай бұрын
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()
@romant6866
@romant6866 5 ай бұрын
Same mene Kiya 😅but ma'am ka code bhi smjho ignore na krna
@StockBabu-1
@StockBabu-1 4 ай бұрын
how many marks you will update? here u have taken only 3 cases consider more number of cases the code shown in video is simpler one
@rahulrc2077
@rahulrc2077 3 ай бұрын
its not simple, lists are easier to handle when there can be a chance that multiple marks have to be added in future. So the code shown in video is better and yours is just Bruteforce and waste.
@Popcornsuddhi
@Popcornsuddhi Ай бұрын
Thank you
@masgrw1
@masgrw1 Ай бұрын
"list" is professional approach
@adityadas7241
@adityadas7241 7 ай бұрын
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())
@abhinavkatiyan8923
@abhinavkatiyan8923 6 ай бұрын
class Student(): def __init__(self,Name,*Marks): self.Name=Name self.Marks=Marks print(f'Welcome {self.Name}') def Avg_Marks(self): total_marks = 0 for i in self.Marks: for mark in i : total_marks += mark # Corrected line for accumulation average = total_marks / len(self.Marks) return f'{average} This is your Average Marks of all the Subjects'
@Starone-x9w
@Starone-x9w 6 ай бұрын
So what is the output
@revenal
@revenal 5 ай бұрын
We try all question and codes
@AhmadJutt850
@AhmadJutt850 5 ай бұрын
that's more easy i think 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()
@farhanrasool7371
@farhanrasool7371 5 ай бұрын
yes i was solved by this when she said puse the video
@harshit_singh19
@harshit_singh19 5 ай бұрын
We want DSA using Python
@GauravThakur-hz3zi
@GauravThakur-hz3zi 2 ай бұрын
yees plss
@factbyrazz152
@factbyrazz152 2 ай бұрын
Yes
@unsolve_writer1245
@unsolve_writer1245 Ай бұрын
Yess
@Mrmastermiindd234
@Mrmastermiindd234 17 күн бұрын
Yes
@rishavthakur3571
@rishavthakur3571 17 күн бұрын
Yes
@joshia_himanshu2004
@joshia_himanshu2004 5 ай бұрын
35.16 class Student: def __init__(self,name,marks): self.name = name self.marks = marks def get_avg(self): return sum(self.marks)/len(self.marks) s1 = Student("Himanshu",[45,89,98]) print("Hi student,",s1.name,"your avg score is ", s1.get_avg())
@CrazyManbypuspendra
@CrazyManbypuspendra 10 ай бұрын
Didi aap itne acche se padhate ho Ek baar main sab kuch clear ho jata hai ❤❤
@nareshkatla1135
@nareshkatla1135 4 ай бұрын
Just started watching your videos and fell in love with the way of teaching ...You look like a student but explanation is amazing
@gt_shades9526
@gt_shades9526 8 ай бұрын
Thanks a lot to Apna college for delivering such a valuable series and that to in very concise manner.
@gchethan9472
@gchethan9472 2 ай бұрын
Hello all This one the best python basic lecture you will ever get, In the entire video she never asked for subscribe or like. Let’s encourage her to do more courses like this and help crores of students and learner’s. Keep up the good work Shraddha and keep on helping people.
@AJosl360
@AJosl360 2 ай бұрын
key concepts by timestamp :-----> 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 thankyou
@asifinam3948
@asifinam3948 13 күн бұрын
Great Job. Completed Python Playlist today. While True: print (like)
@RevolutionaryWorld12
@RevolutionaryWorld12 6 күн бұрын
mubarik ho bhai sb! laikin ab kuch faida ni rha kaam krne ka , saturation kafi ho chuki hai
@jayshreeSonawane-y9q
@jayshreeSonawane-y9q 3 ай бұрын
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): print((self.sub1+self.sub2+self.sub3)/3) s1 = Avg("Om patil",90,90,90) s1.average()
@akhileshghatate4157
@akhileshghatate4157 5 ай бұрын
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): self.balance=self.balance+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()
@makarsh29
@makarsh29 2 ай бұрын
29:17 we can provide default if some one did not gave their name def __init__(self, fullname="unknown", profession="student"): self.name = fullname self.profession = profession print("adding new student in database...............") while defining constructor
@jasmeetsinghbagga4095
@jasmeetsinghbagga4095 8 ай бұрын
Thankyou Shraddha Didi for making OOPS easy to understand.
@Ritesh.s
@Ritesh.s 5 ай бұрын
It is not OOPS IT IS OOP
@JAVPindia0
@JAVPindia0 3 ай бұрын
Han to bolenge opps to you
@princeuchiha6952
@princeuchiha6952 3 ай бұрын
time : 36:00 class Student: def __init__(self,name,mark1,mark2,mark3): self.name=name self.mark1=mark1 self.mark2=mark2 self.mark3=mark3 def get_avg(self): return (self.mark1 + self.mark2 + self.mark3)/3 S1=Student("Praveen",70,67,78) print(S1.name,S1.mark1,S1.mark2,S1.mark3) print(S1.get_avg())
@shaileshsondawale8765
@shaileshsondawale8765 9 күн бұрын
Shradha.. Awesome way of teaching.. A Very good Delivery..!!!
@SPOTY007
@SPOTY007 Ай бұрын
This was amazing and easy to understand.shradhha is always teachs deeply and smoothly.❤
@KAU717
@KAU717 7 ай бұрын
Plz teach us DSA in python
@DEwithDhairy
@DEwithDhairy 6 ай бұрын
Follow my KZbin channel Oops in python ( taught real world schenarios) kzbin.info/www/bejne/Y4GbqmStd9t3p7csi=ZTdkT63MsaSuj3-5
@ankitkumarprajapati8384
@ankitkumarprajapati8384 4 ай бұрын
Yes plz
@Idnini
@Idnini 4 ай бұрын
Yes please kzbin.info/www/bejne/hmG2ZpR_d86cqNksi=xYxY7t272-Rnq77r
@nazeyasyed4683
@nazeyasyed4683 3 ай бұрын
Haa didi please
@nazeyasyed4683
@nazeyasyed4683 3 ай бұрын
Haa didi please
@shatayuk
@shatayuk 2 ай бұрын
I really appreciate the efforts you have taken and the effortlessness with which you are teaching
@thinkoutofbox7985
@thinkoutofbox7985 10 ай бұрын
thanks di...... i was waiting for this lecture to come soonn.....
@dpyagnik
@dpyagnik 5 ай бұрын
34:50 # try this and thank me later :) class Eleventh: marks = 0 def __init__(self, name, mark): self.name = name self.marks = mark def Check_average(self): i = 0 added = 0 while i < len(self.marks): added = added + self.marks[i] i+=1 return added/i marks = [] s1 = Eleventh("Devarsh", marks) i = 1 while i > 0: i = (int(input("Enter Your Marks(Enter a negative value to stop): "))) if(i > 0): marks.append(i) else: break print(s1.Check_average())
@shaileshsondawale8765
@shaileshsondawale8765 10 күн бұрын
Hello Shradha.. Your way of teaching is at par level..
@dronayt2010
@dronayt2010 16 күн бұрын
34:40 def __init__(self,fullname,marks,subjects): self.name = fullname self.marks = marks self.subject = subjects def avg(self): sum = self.marks["pys"] + self.marks["cem"] + self.marks["maths"] av = sum / 3 return av pys = int(input("Enter the marks of pys: ")) cem = int(input( "Enter the marks of cem: ")) math = int(input("Enter the marks of math: ")) s1 = Student("Don",{"pys": pys, "cem": cem, "maths": math},["pys", "cem", "maths"]) print(s1.name, s1.marks, s1.subject) print(f"so the avg this around:",s1.avg())
@dronayt2010
@dronayt2010 16 күн бұрын
and without using class: pys = int(input("Enter the marks of pys: ")) cem = int(input( "Enter the marks of cem: ")) math = int(input("Enter the marks of math: ")) name = input("So whats the students name?: ") list = [pys,cem,math] def avg(list): sum = pys + cem + math av = sum / 3 print(name,av) avg(list)
@lk1470
@lk1470 10 ай бұрын
#c or c++ is next topic 😊😊... Love alot ❤❤❤ classes whith hv good content obj
@salonikasera6283
@salonikasera6283 10 ай бұрын
Thanks for teaching you are a great teacher👌👌👌
@Sanjivakumar
@Sanjivakumar 17 күн бұрын
Thank you Shradha.... Nice Explanation....Clear cristal Explanation
@udaygawande104
@udaygawande104 10 ай бұрын
I needed this video ❤.. Thank you so much ma'am❤ .. Means a lot 💕🙏🏻🥺
@pradeepahirwar3663
@pradeepahirwar3663 10 ай бұрын
Nice Session Very Useful. 🎉❤Thank you ma'am.
@vandanalaydan7584
@vandanalaydan7584 Ай бұрын
Loveable examples used❤
@YONAnYONA
@YONAnYONA 8 ай бұрын
Hi Didi, I searched many videos to understand about classes but your video about OOPS helped me alot to understand the concept and the coding part. watching this Video I tried writing below code which is slight different from yours. I got a doubt that you used loop for calculating and reading average. I agree we can write coding as we like but just wanted to know if there is any specific reason to it you choose loops. class Student: def __init__ (self, name, marks): self.name= name self.marks= marks def average (self): average= sum(self.marks)/len(self.marks) print("Average of",s1.name,"is", average) s1=Student("Karan",[25,36,42]) s1.average() s2=Student("Manoj",[96,82,89]) s2.average()
@Gamer_Harsh7572
@Gamer_Harsh7572 8 ай бұрын
your code showing me an error
@sktechsofficial
@sktechsofficial 3 ай бұрын
Hahaha​@@Gamer_Harsh7572
@VarshaSorout-vj9is
@VarshaSorout-vj9is 2 ай бұрын
@@Gamer_Harsh7572 😂
@subhamgiri2000
@subhamgiri2000 25 күн бұрын
''' create student class that takes names & marks of 3 subjects as arguments in constuctors. Then create a method to print the average. ''' class student (): def __init__(self, name, marks1, marks2, marks3): self.name = name self.marks1 = marks1 self.marks2 = marks2 self.marks3 = marks3 def average_calculation(self): sum = self.marks1+self.marks2+self.marks3 average = sum/3 return average obj1 = student("Subham", 66,75,97) obj2 = student("Hemanga", 55,65,23) print("Hello!",obj1.name,"Your marks are here:", obj1.average_calculation()) print("Hello!",obj2.name,"Your marks are here:", obj2.average_calculation())
@Pardhu-g5g
@Pardhu-g5g 9 күн бұрын
nice explanation shradha didi 😍😍
@VedantEarly-pq1mm
@VedantEarly-pq1mm 8 ай бұрын
54:20 please someone explained me what does mean by self.balance -= amount My question is why that minus sign is at LHS rather than RHS. 🙏🙏
@MdFaizanAhmad-z5h
@MdFaizanAhmad-z5h 8 ай бұрын
That means Balance= Balance -amount
@saifulislamislam9281
@saifulislamislam9281 10 ай бұрын
I learned a lot from this course Thanks .👍
@arshzeelani1420
@arshzeelani1420 3 ай бұрын
Earlier I used to think that "opp" is very difficult but your video has cleared my misconception 😊
@kkrhatharva
@kkrhatharva 2 ай бұрын
class student: def __init__(self,name,mark1,mark2,mark3): self.name=name self.mark1=mark1 self.mark2=mark2 self.mark3=mark3 self.avg=(mark1+mark2+mark3)/3 def marks_avg(self): print("Average marks is ",self.avg) name=input("Enter your name :") mark1=float(input("Enter marks 1 :")) mark2=float(input("Enter marks 2 :")) mark3=float(input("Enter marks 3 :")) s1=student(name, mark1, mark2, mark3) s1.marks_avg()
@Krishna-ez1xy
@Krishna-ez1xy 3 ай бұрын
the way you explain op i watch many video to understand init and static method you explaination is best
@Saroj-j9y6h
@Saroj-j9y6h 2 ай бұрын
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.
@usmanganni5684
@usmanganni5684 25 күн бұрын
I love your teaching style maam
@simp.history
@simp.history 24 күн бұрын
I did it like this: class students: def average(n1,n2,n3): numbers = [n1,n2,n3] avg = sum(numbers)/len(numbers) return avg name_of_sub1 = input('Subject name: ') name_of_sub2 = input('Subject name: ') name_of_sub3 = input('Subject name: ') sub1 = int(input(f'Enter marks in {name_of_sub1}: ')) sub2 = int(input(f'Enter marks in {name_of_sub2}: ')) sub3 = int(input(f'Enter marks in {name_of_sub3}: ')) s1 = students.average(sub1,sub2,sub3) print(f'The average marks are: {s1}')
@simp.history
@simp.history 24 күн бұрын
I think my utalization of Class is wrong as I solely relied on Def function, please guide me as I'm not much familiar with coding, my major is CIVIL.
@MDSAKIBULISLAM-e7g
@MDSAKIBULISLAM-e7g 2 ай бұрын
thanks sis, your vdo always best_ take love from bangladesh_💌
@bengalurubulls8429
@bengalurubulls8429 2 ай бұрын
37:38 can we do len(self.marks) instead of sum/3 if the user enters more marks
@SuperJajati
@SuperJajati 2 ай бұрын
Nice example of car. Great mam.❤
@4YUxHiitr
@4YUxHiitr 3 ай бұрын
At 46:00, ma'am apne brake tho nahi hataya, car chalegi kaise??
@Hamza_Ali_Khan
@Hamza_Ali_Khan 4 ай бұрын
It was a great lecture, each and every topic/point is explained very simply.
@thegodevil3703
@thegodevil3703 2 ай бұрын
class Students: def __init__(self, name, marks): self.name = name self.marks = marks print ("Hello", self.name, "your marks are - ", self.marks) def average_of_marks (self): total_sum = sum(self.marks) average = total_sum/len(self.marks) print(average) student1 = Students("krishna",[9,8,8]) student1.average_of_marks()
@The_open_file
@The_open_file 9 ай бұрын
Really love you madam ❤ Kai dino se samjhne ki kosis kar Raha tha aj Jake samjha😊
@qamberabbas4304
@qamberabbas4304 4 ай бұрын
Thank you Shradha Khapra
@AllEntertainmentwiththreebros
@AllEntertainmentwiththreebros 10 ай бұрын
Love from Bangladesh ❤❤❤❤ Didi
@raohammadraza
@raohammadraza 6 ай бұрын
Your course is very good and your teaching method is very good you are doing a good job and keep it up plz have a request to bring C++ DSA course.
@arnab30dutta
@arnab30dutta 5 ай бұрын
@shradhaKD What is the setup used in making this video? kindly mention : *a)* how a portion of screen shows you in below right corner *b)* are you using any screen recording software? *c)* are you using any specific software where hand drawn circle changes to a nice circle automatically ? *d)* are you using iPad ? *e)* how r u mirroring iPad on Laptop screen ?...etc - I shall be obliged and grateful if you kindly share all those details please. Thanks ahead 🙏
@NISHANT_YADAV_IITM
@NISHANT_YADAV_IITM 3 ай бұрын
yt karo sir
@akanshasingh3925
@akanshasingh3925 23 күн бұрын
Amazing lecture!!
@shakshitiwari-yh1ko
@shakshitiwari-yh1ko 10 ай бұрын
Thanks didi aap bohat accha pardhate ho thank you so 😊😊
@aafimalek
@aafimalek 10 ай бұрын
finally completed the whole series thanks Shradha ma'am
@onlygaming209
@onlygaming209 10 ай бұрын
when I try to write 2 constructors, one is default and second is parametrized then try to create object using default constructor, it shows an error that it requires positional argument. I have learned OOPs in java where function overloading works, I'm trying to do the same thing but in python only the constructor that is written at end is being called, all previous ones are being ignored, why ?
@lifefact8398
@lifefact8398 10 ай бұрын
I also done the same work in C++ but in Python working is different. As she said we can only create on constructor's object in the program. We can use default or parametrized constructor at a time. It is not possible to use both..
@onlygaming209
@onlygaming209 10 ай бұрын
@@lifefact8398got it, thanks
@astrost5612
@astrost5612 5 ай бұрын
This just made life a whole lot easier 😊.
@SuryaSaithana-ue1dq
@SuryaSaithana-ue1dq 6 ай бұрын
18:29 What is the significance of the print statement after self.name = fullname.
@adityakushwaha6358
@adityakushwaha6358 10 ай бұрын
Waha mam pura KZbin hila Diya 😂
@Mariyam-yw8fx
@Mariyam-yw8fx 6 ай бұрын
27:39 *when she wrote (Stduent.college_name) then why was it only showing the college name with Arjun it should have shown it with Karan also because Student value is in both of them*
@shivamkrsinha777
@shivamkrsinha777 4 ай бұрын
your example of car helped me to learn it in the first time.
@mylovelykids5795
@mylovelykids5795 6 ай бұрын
You are awesome !! You are doing a great job and millions of students can get benefit of it. Please keep up the good work !! Can you please make videos for "QA and Software Test Automation".
@poorvikr2128
@poorvikr2128 Ай бұрын
thank you mam, you made it very easy !!!!
@Pardhu-g5g
@Pardhu-g5g 28 күн бұрын
osm expalantion ...you told bank account is it example for encapsulation? any plz reply
@kuldeepsikarwar6613
@kuldeepsikarwar6613 10 ай бұрын
Medam ji jis name se class banate hai to ushka object ushi name se hota hai ya name koi alaga de sakte hai Reply jarur karna
@lifefact8398
@lifefact8398 10 ай бұрын
we can give any name (as we want) to the object using naming rules.
@varshinimg1049
@varshinimg1049 5 ай бұрын
Best supporting tutor!!!❤ever Didi what is the secret of ur teaching which can easily attract the students who really want to learn!!!❤
@Muskan-zy7ly
@Muskan-zy7ly 19 күн бұрын
Q: CREATE A STUDENT CLASS THAT TAKES NAME AND 3 SUBJECTS AS ARGUEMENTS IN CONSTRUCTOR, THEN CREATE THE METHOD TO PRINT THEIR AVERAGE !!! ANS : class Student: def __init__(self,fullname,sub1,sub2,sub3): self.name=fullname self.a=sub1 self.b=sub2 self.c=sub3 def cal_avg(self): return ((self.a+self.b+self.c)/3) s1=Student("karan",98,89,95) print("The student name here::",s1.name) print("The marks of subject 1::",s1.a) print("The marks of subject 2::",s1.b) print("The marks of subject 3::",s1.c) print("The average of subjects::",s1.cal_avg())
@shivkumargaming
@shivkumargaming 10 ай бұрын
Love you mam❤
@Kishan_Experiment
@Kishan_Experiment Ай бұрын
Very interesting ❤
@rohandhruva9466
@rohandhruva9466 6 ай бұрын
nailed it bro in the explanation...
@piyushshende6324
@piyushshende6324 7 ай бұрын
in last code the code can show -ve balance which is not good. i corrected the code with if else loop class account: def __init__(self, bal, acc): self.balance = bal self.account_no = acc def debit(self, amount): self.balance -= amount if amount
@TejasPrakashninawe
@TejasPrakashninawe 5 ай бұрын
Mam your teaching very good I have learn python very well But you have not teach how to Make graphics programs so I Suggest you to teach graphics Making in python Thank you for teaching 😊
@pradeeprathor4011
@pradeeprathor4011 6 ай бұрын
Mam please tell me how to create class jisme hum bas ek bar do no. Le or humhe bar bar use change na kare uspe add ,sub multi.ka operation perform kara ske
@banna_sandipsinh8080
@banna_sandipsinh8080 3 ай бұрын
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:-")))
@SwarnavoNathD4
@SwarnavoNathD4 6 ай бұрын
i cant get any output of any program in vsi codes its always saying "The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding." ANY SOLUTION PLZ HELP
@tonds0001
@tonds0001 10 ай бұрын
Are ❤ jaldi sab lecture upload kar ke public karo na please 🥺
@MoNiL_DeVLuK1111
@MoNiL_DeVLuK1111 2 ай бұрын
L-8 DONE 🚀
@rockstar4507
@rockstar4507 9 ай бұрын
Just a small question:- Can we say Global variable to class attribute and Local variable to object attribute???
@norenlee479
@norenlee479 6 ай бұрын
Thanks a lot you Shradha from Nepal. You rock.
@SaifAli-eh8lq
@SaifAli-eh8lq 3 ай бұрын
It helps me alot❤
@ishastudies8589
@ishastudies8589 10 ай бұрын
Didi kuch project ke bhi tutorial upload kar do java script me😊😊
@mubashirhussain555
@mubashirhussain555 10 ай бұрын
very helpful , please continue this series
@anushkamidda8236
@anushkamidda8236 Ай бұрын
49:00 #CREATE A CLASS AS ACCOUNT AND TAKE 2 ATTRIBUTES -BALANCE AND ACCOUNT NO .CREATE METHODS FOR DEBIT CREDIT AND PRINTING THE BALANCE class Account: def __init__(self,bal,acc_no): self.bal=bal self.acc_no=acc_no def debit(self,debt): if(self.bal>=debt): self.bal=self.bal-debt print("debited balance is:",debt," ","New balance is:",self.bal) else: print("Insufficient balance") def credit(self,cred): self.bal=self.bal+cred print("credited balance is:",cred," ","New balance is:",self.bal) def print_bal(self): print("Acoount no:",self.acc_no) print("The current balance is:",self.bal) c1=Account(12000,8100531337) print("THE DETAILS OF CUSTOMER:") print("Account no:",c1.acc_no) print("Previous balance:",c1.bal) c1.debit(2000) c1.credit(4000) c1.print_bal() '''output: THE DETAILS OF CUSTOMER: Account no: 8100531337 Previous balance: 12000 debited balance is: 2000 New balance is: 10000 credited balance is: 4000 New balance is: 14000 Acoount no: 8100531337 The current balance is: 14000 '''
@learnwithnagma
@learnwithnagma 10 ай бұрын
Done didi 👍. I enjoy coding via learning from you. I practice coding everyday ✌️✨.
@learnwithnagma
@learnwithnagma 10 ай бұрын
@sugerfarm I am in 11th now .
@ShadowKing010
@ShadowKing010 8 ай бұрын
​​​@@learnwithnagmaboard mei kitne % aaye 🧐
@learnwithnagma
@learnwithnagma 8 ай бұрын
@@ShadowKing010 10 th me 94% . Next year 12th
@ShadowKing010
@ShadowKing010 8 ай бұрын
@@learnwithnagma topper bhaiii 🫡🫡🫡 All the best for 12th Me bhi 12th me aaunga ab Pass ho gaya to
@learnwithnagma
@learnwithnagma 8 ай бұрын
@@ShadowKing010 Just have faith in time , sab awesome way me ho jayega!
@HamzajavaidJavaidIqbal
@HamzajavaidJavaidIqbal 10 ай бұрын
Is there any other video of oops coming Thank you
@shafatpir1097
@shafatpir1097 5 ай бұрын
this lecture helps me a lot thanks teacher
@abhisheksaini8198
@abhisheksaini8198 10 ай бұрын
Canada me aake 25 lakh college ko dene bd bii pdayi hmm Shradha mm se krre h🙃❤ Shradha mm teaching level 🔥 ❤
@durgashankarchoudhary1895
@durgashankarchoudhary1895 10 ай бұрын
Go to apna college channel
@ShadowKing010
@ShadowKing010 8 ай бұрын
Bhai itni fees hoti hai kya vha ☠️
@realdevanshbajpai
@realdevanshbajpai 5 ай бұрын
# Here's my solution to 50:00 import random acc_no_data = [] class Account: def __init__(self, balance=100): self.balance = balance check = True while check == True: mock_ac_no = random.randint(1000000, 9999999) if mock_ac_no not in acc_no_data: acc_no_data.append(mock_ac_no) self.acc_no = mock_ac_no check = False def debit(self, amount): if self.balance >= amount: self.balance -= amount else: print('insufficient funds') def credit(self, amount): self.balance += amount def get_balance(self): print('your current balance is', self.balance)
@absulsallam7808
@absulsallam7808 10 ай бұрын
Apke lecture bht hi ache he concept clear hojata he
@deepayadav8740
@deepayadav8740 5 ай бұрын
Is it necessary that every codes will run on any platform? Or we can learn only concept sometimes if programs don't run
@harshitsharma8022
@harshitsharma8022 Ай бұрын
10:39 how to comment out all lines together
@varickvision_12
@varickvision_12 29 күн бұрын
select all lines and press Ctrl + slash buttons.... and do same thing to undo it....
@tenzinuzi7589
@tenzinuzi7589 Ай бұрын
Im confused!! Help…Why she didnt used self.amount when processing debit and credit,its ok to use amount?
@Mr_sharif555
@Mr_sharif555 3 ай бұрын
Hello brothers my pycharm can't work properly when i create a code when i run code result can't show
@ancydcunha8121
@ancydcunha8121 8 ай бұрын
Thank You Didi
@kirannair7920
@kirannair7920 8 ай бұрын
video time "53 min" is it necessary to create a new method called get_balance or above ,along with debit and credit method down we can print (self.balance)..??? i
@Fun_facts_Zzz
@Fun_facts_Zzz 8 ай бұрын
Not required
@Surendra-g6m
@Surendra-g6m Ай бұрын
NameError Traceback (most recent call last) Cell In[12], line 1 ----> 1 class Student: 2 def __init__(self, name, marks): 3 self.name = name Cell In[12], line 13 9 sum += val 11 print("hi", self.name, "your avg score is ", sum/3) ---> 13 s1 = Student("tony stark", [99,98,97]) 14 s1.get_avg() NameError: name 'Student' is not defined. not working
@asutoshgudu285
@asutoshgudu285 7 ай бұрын
Can you please represent the COPY CONSTRUCTOR in python.... 22:52
@Nibbi-r7i
@Nibbi-r7i 10 ай бұрын
I have been facing problem regarding python download u r making videos but plz reply the comments after clicking version nothing shows
Lecture 9 : OOPS Part 2 | Object Oriented Programming | Python Full Course
1:09:06
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 71 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,6 МЛН
Object Oriented Programming in python
1:08:29
Chai aur Code
Рет қаралды 102 М.
I'm 24. If you're 14-23 please watch this...
6:37
Tharun Speaks
Рет қаралды 626 М.
FASTEST Way to Learn Coding and ACTUALLY Get a Job
6:32
Rajeev Bera
Рет қаралды 28 М.
Lecture 6 : Functions & Recursion in Python | Python Full Course
1:01:48
Shradha Khapra
Рет қаралды 679 М.
Reality of my Google Salary after TAXES
6:54
Fraz
Рет қаралды 300 М.
Web Development Complete RoadMap for 2025 | from Basics to Advanced
22:00
5 High Paying Skills I'm learning in 2025!
12:10
Tharun Speaks
Рет қаралды 279 М.
Lecture 7 : File Input/Output in Python
50:48
Shradha Khapra
Рет қаралды 457 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН