OOP Part 2 | Encapsulation & Static Keyword | Static | Data Science Mentorship Program(DSMP) 2022-23

Поделиться
HTML-код
  • Опубликовано: 19 авг 2024

Комментарии • 101

  • @nitikjain993
    @nitikjain993 Год назад +49

    Best teacher ......I have never seen such a hard working teacher like you .......salute you sir .....lots of love

  • @Geschwindigkeit1
    @Geschwindigkeit1 Месяц назад +9

    In the last part of STATIC VARIABLE - 2:10:10
    Thing have changed now due to future update in PYTHON (04/07/2024)
    - now it does not throw any error
    Explaination :-
    Error in Older Versions: If you encountered errors when calling methods through instances in older versions, it might have been due to improper handling of method types before the @staticmethod decorator was introduced.
    No Error in Modern Python: In modern Python versions (Python 3.x), calling static methods through instances works seamlessly because Python recognizes and resolves the call appropriately, avoiding any unexpected arguments being passed.
    WE CAN NOW USE BOTH WAYS : -
    Calling Static Methods
    Static methods can be called in two ways:
    1. Through the class: ClassName.methodName()
    2. Through an instance: instance.methodName()
    1. Atm.get_counter()
    2.
    c1 = Atm()
    c1.get_counter()
    Hope this help any person in future who is studying this concept

  • @Jagrut_Guy
    @Jagrut_Guy 8 месяцев назад +5

    The way you explain from zero is just extraordinary 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏From today onwards you are my guru

  • @hamantjagwan07
    @hamantjagwan07 10 месяцев назад +5

    You are doing a great charity work here. The values you are creating are much bigger than what anyone can think. Thank you, Guru Ji.🙏🙏🙏

  • @flakky1262
    @flakky1262 Год назад +6

    Its my first time getting this excited after being taught by someone..."INCREDIBLE hattts of to you sir" youre doing a greatest work appreciate a lot

  • @azizullah5603
    @azizullah5603 Год назад +4

    Your Python tutorials are an absolute masterpiece! Your passion, clarity, and dedication make learning Python an incredible experience. Thank you for being an extraordinary teacher.Love from Pakistan

  • @its._ankur
    @its._ankur Год назад +7

    Sir ji maza aagya junior -senior wali story se samajh kr ❤

  • @lipaacharjee9083
    @lipaacharjee9083 6 месяцев назад

    Sir aap Bhagwan ho, if we will have many teachers like, the country will change. Many many thanks to you for such Data Science Playlist 🙏🙏🙏🙏🙏

  • @Aestheticdeeps
    @Aestheticdeeps Год назад +2

    no one can explain better than you sir!💯 you nailed it sir🙌👏 thank you sooo much 😇❤

  • @randomworld4807
    @randomworld4807 Месяц назад

    Nitish sir you are truly a god level teacher .. Salute to you

  • @messi0510
    @messi0510 Год назад +1

    49:05-->50:50 Accessing class attributes and we can also create the from outside the class
    57:35-->59:00 Reference variable
    1:45:25-->1:47:30 What is encapsulation

  • @Noob31219
    @Noob31219 Год назад +8

    Great session as always Thanku sir

  • @akashprajapati6635
    @akashprajapati6635 9 месяцев назад +4

    College me Paisa bhar ke ..sab Paisa barbaad 😢😢........kitna achha sikhate hai sir 😊....

  • @ComicKumar
    @ComicKumar Год назад +1

    Great lecture sir..watched it twice already. Can't thank you enough.
    one correction at 2:10:51 , after adding @staticmethod keyword before get_counter method, you can access the get_counter() method by creating the object of the class.
    ie. c1 = Atm() ---> c1.get_counter() will work now as mentioned at 2:10:09 now it will not throw error.

  • @K_SE__VishalRoyRoy
    @K_SE__VishalRoyRoy Год назад +2

    wow! here I getting every things with better understanding

  • @amitkumar2005
    @amitkumar2005 2 месяца назад

    Nitish Sir Aap great ho... Aaj tak aapke jaise teacher nhi dekha !!

  • @rahuldande2
    @rahuldande2 11 месяцев назад

    Jaha PNA tusi great ho sir great explanation and I really understand oops concepts I had tired to seeing so many videos of oops but you're the one actually jise smjne m asani Hui thanks sir j.

  • @siddhigolatkar8558
    @siddhigolatkar8558 Год назад +2

    Thank you Sir .. Awesome way of teaching through story the concept of encapsulation

  • @prudhvivardhan
    @prudhvivardhan Год назад +2

    Thank you sir for the deep Explanation with funny example about Encapsulation.

  • @lokeshagarwal3303
    @lokeshagarwal3303 9 месяцев назад +1

    Super se uper ... Lucid explanation ❤

  • @veernarwar8048
    @veernarwar8048 Год назад +2

    Hello Sir! first of i would like to appreciate your efforts you put to teach us, this is really awesome. I am following your playlist of Ml and Deep learning also, but sometimes i need to revise past things, which is a tough task for me , because i cannot write everything in my notebook, because it take a lot of time, so sir can you pls upload all the notebooks of Onenote of ML and Deep Learning playlists....

  • @arrearpan
    @arrearpan 7 часов назад

    Koti koti naman aapko🙏🏻🙏🏻❤❤

  • @aashutoshchoure3821
    @aashutoshchoure3821 27 дней назад

    nice expalined encapsulation topic with why

  • @abdulahmed5610
    @abdulahmed5610 Год назад +1

    Key Take aways from this lecture:
    1) BYJUs wale... I also hate them
    2) p=q (reference variable wla concept)
    3) harami junior ka "hehehe"
    4) getter & setter
    5) Static method (@decorator)

  • @princeprasad5733
    @princeprasad5733 5 месяцев назад

    Today is Sunday and I just watched a movie and after watching it I just wanted to revise my oops in python and I saw this video trust me encapsulation wale part me me Jo hasa hu, mujhe jo maza aya is far better than that 2.5hrs movie 😂😂😂❤❤

  • @malharprajapati2736
    @malharprajapati2736 6 месяцев назад +1

    # Function to find if lines intersect each other
    def does_lines_intersect(line_1,line_2):
    """
    =============================================================================
    Function does_lines_intersect is used to find if 2 lines intersect each other
    Accepts -> First line object AND Second line object
    Returns -> Print statement
    =============================================================================
    """
    # Checking if both object belong to appropriate class
    if (not isinstance(line_1,Line)) or (not isinstance(line_2,Line)): return print("Please provide 2 line object")

    # Formula ->
    try:
    a1, b1, c1 = line_1.A, line_1.B, line_1.C
    a2, b2, c2 = line_2.A, line_2.B, line_2.C
    Numerator = ((b1 * c2) - (b2 * c1)) / ((a1 * b2) - (a2 * b1))
    Denominator = ((a2 * c1) - (a1 * c2)) / ((a1 * b2) - (a2 * b1))
    except ZeroDivisionError:
    return print("Lines don't intersect")

    return print("Lines intersect at -> ",Point(Numerator , Denominator))

    • @hariskundi6653
      @hariskundi6653 5 месяцев назад +1

      def lines_intersection(line1, line2):
      if -(line1.A/line1.B) != -(line2.A/line2.B):
      return "two lines intersect"
      else:
      return "two lines don't intersect"
      l1.lines_intersection(l2)
      # the first argument 'line1' of line_intersection function by default goes to l1 object and second argument 'line2' goes to L2 object.
      # if m1 is equal to m2, the two lines will not intersect
      # m1 = - A1/B1, m2= -A2/B2

  • @naveenbhandari5097
    @naveenbhandari5097 7 месяцев назад

    really really insightful video I have ever seen!

  • @arindamInsightFullMath
    @arindamInsightFullMath 2 месяца назад

    What a explanation sir ji😮😮 hats off ❤❤❤❤❤❤❤❤

  • @PyCoach
    @PyCoach 4 месяца назад

    Best Teacher
    GOAT

  • @RupeshSingh87
    @RupeshSingh87 Год назад +2

    Static variables are only scoped till the execution of the program so static is also technically sometimes not that useful.

  • @VIGNESHS-hs8nl
    @VIGNESHS-hs8nl 9 месяцев назад

    Best explanation and thanks for all your efforts 🙏

  • @ish8591
    @ish8591 Год назад

    1:12:17 sir pr maine toh suna tha ki strings are immutable..... sir mutable vo hote hai jinn me hum existing input me changes kr sake or immutable vo jinn me hum small changes nahi kr sakte existing input me toh seedha new input bnana padta.

  • @karankeshav1
    @karankeshav1 Год назад +1

    if any senior programmer will see this video then junior programmer and junior programmer's 'hehehe' will be the nightmare after watching this video

  • @pratikbhoodatt6870
    @pratikbhoodatt6870 7 месяцев назад

    best video on entire youtube

  • @UNKNOWN-vi7li
    @UNKNOWN-vi7li 11 дней назад

    "METHOD FOR LINE INTERSECTION"
    def line_intersect(line,line1):
    m1 = line.A/line.B
    m2 = line1.A/line1.B
    if m1 == m2:
    return("given lines are parallel")
    x_int = (line.B*line1.C - line1.B*line.C)/(line.A*line1.B - line1.A*line.B)
    y_int = (line1.A*line.C - line.A*line1.C)/(line.A*line1.B - line1.A*line.B)
    p = Point(x_int,y_int)
    if line.shortest_distance(p)==0 and line1.shortest_distance(p)==0 :
    return("given lines do intersect")
    else :
    return("given lines do not intersect")

    • @UNKNOWN-vi7li
      @UNKNOWN-vi7li 10 дней назад

      CORRECTED CODE:
      (as above code is not reliable for lines like x=3 and x=4)
      def line_intersect(line,line1):
      m1,m2 = "slope1","slope2"
      if line.B == 0 and line1.B == 0:
      return "given lines are parallel"
      elif line.B!=0 and line1.B!=0:
      m1 = line.A / line.B
      m2 = line1.A / line1.B
      if m1 == m2:
      return "given lines are parallel"
      else:
      return "given lines do intersect"
      else :
      return "given lines do intersect"
      because in coordinate geometry, lines are either parallel or intersecting

  • @sadiq8842
    @sadiq8842 Месяц назад

    def exist_on_line(self,A,B,C):
    Line = self.A + self.B + self.C
    if Line == 0:
    return "exist on line "
    else:
    return "not exist on same line "
    is this approach correct

  • @ajeetsejole7862
    @ajeetsejole7862 5 месяцев назад

    Awesome explaination

  • @GAURAVSINGH-ez5oe
    @GAURAVSINGH-ez5oe 6 месяцев назад

    thnx uh sir to make this video free

  • @harshvardhansingh5647
    @harshvardhansingh5647 Год назад

    Great teacher......

  • @Yeahmansingh
    @Yeahmansingh 2 месяца назад

    CAN'T BELIEVE THIS IS FREE

  • @kameshkotwani2714
    @kameshkotwani2714 Год назад +3

    Implementation of Abstraction is known as Encapsulation.

  • @HamzaAli-rt4pp
    @HamzaAli-rt4pp Год назад +1

    great story❤‍🔥

  • @AlgoTribes
    @AlgoTribes Год назад +1

    what if the line equation has rhs value other than zero?how to generalise then?timestamp ~33mins

  • @aatif_kh8n
    @aatif_kh8n 2 месяца назад

    01:38:30 Nothing is private in Python. Python is made for mature programmers. Feature ❌ Excuse ✅

  • @sandeepdalal1181
    @sandeepdalal1181 Год назад

    Great Sir, Thankyou.

  • @siddheshdhanawade3709
    @siddheshdhanawade3709 8 месяцев назад

    king of ds

  • @p1prernasaini
    @p1prernasaini Год назад

    I see.,
    So in term of oop an immutable object is an object in which no modification can be done.
    But if do so an entirely different object will be created in the memory.

  • @sujithsaikalakonda4863
    @sujithsaikalakonda4863 Год назад

    Very well explained sir.

  • @lokeshagarwal6373
    @lokeshagarwal6373 10 месяцев назад

    You are very Amazing

  • @shashankshekharsingh9336
    @shashankshekharsingh9336 8 месяцев назад

    another masterpiece💥💥

  • @ghulammohyuddin9221
    @ghulammohyuddin9221 Год назад

    world class coaching

  • @sandeepsingh-zk3yj
    @sandeepsingh-zk3yj Год назад

    quality content

  • @satyajitsahoo1707
    @satyajitsahoo1707 6 месяцев назад

    I am looking for an answer or hint of second problem of Task (the deck card problem), where do i found the solution?

  • @licklock8406
    @licklock8406 Год назад

    yahi hot hai diff aur sab youtuber me aur ki aap real life company ka scenario bata pata ho
    private wala bahut sai tha
    love u sir :)

  • @umeshpandey5226
    @umeshpandey5226 Год назад

    Best ever ...

  • @kkkkkkkkk819
    @kkkkkkkkk819 Год назад

    best teacher 😍

  • @user-uu9zq2qo8j
    @user-uu9zq2qo8j 11 месяцев назад

    You are the besttttttttttttttttttttt

  • @user-vy5sg2lp1w
    @user-vy5sg2lp1w 8 месяцев назад

    great

  • @arbaazchaudhari2337
    @arbaazchaudhari2337 Год назад

    While running the code on Google colab the connection interrupts again and again . I tried it on Jyputer notebook as well there kernel is dead is showing while running the oop code

  • @knowledgewithutkarsh8619
    @knowledgewithutkarsh8619 10 месяцев назад

    Bhaiya mujhe sirf aapki hi class samjh aati hai but aapne to sessions paid kr rkkhe hai afford nhi kr skta mei but

  • @ruchiyadav7873
    @ruchiyadav7873 11 месяцев назад

    Firstly, Iwan tto thank you Sir a million times. because Python mere liye tough this but now after your lectures its really fun and understandable.
    I have got a doubt at 1:07:23
    class Person:

    def __init__(self,name, gender):
    self.name=name
    self.gender=gender

    def greet(person):

    person.name = 'ankit'
    print(person.name)

    p=Person('xyz','male')
    greet(p)
    print(p.name)
    but when global keyword example me
    def h(y):
    global x
    x+=1

    x=5
    h(x)
    print(x)
    it was not allowing !!!! please explain

  • @mahipalmahato7648
    @mahipalmahato7648 Год назад

    01:14:00 restart

  • @delusional_being
    @delusional_being Год назад

    Thankyou sir

  • @create_past
    @create_past Год назад

    Maja aa gya sir 😁

  • @user-qc6jw4ht6v
    @user-qc6jw4ht6v Год назад

    Thank you so much

  • @attaullah4998
    @attaullah4998 Год назад

    I have a question at time stamp 49: 50 minute. We want to access a non existing attribute gender of class. The rror we get is 'Person' object has no attribute 'gender'. We know that Person is the class ,but in the error it is showing it an a object, can you please explain why?
    Here Per

  • @beatificmusic1048
    @beatificmusic1048 7 месяцев назад

    What happened if it will write obj.get_balance() = 'hehehe' 1:46:09

  • @siddhigolatkar8558
    @siddhigolatkar8558 Год назад

    def intersection_point(line, other):
    if (line.A * other.B - other.A * line.B) != 0:
    x = round((line.B * other.C - other.B * line.C) / (line.A * other.B - other.A * line.B))
    y = round((other.A * line.C - line.A * other.C) / (line.A * other.B - other.A * line.B))
    return "The given lines intersect at Point({},{})".format(x,y)
    else:
    return "The given lines does not intersect each other"

    • @hariskundi6653
      @hariskundi6653 5 месяцев назад

      def lines_intersection(line1, line2):
      if -(line1.A/line1.B) != -(line2.A/line2.B):
      return "two lines intersect"
      else:
      return "two lines don't intersect"
      l1.lines_intersection(l2)
      # the first argument 'line1' of line_intersection function by default goes to l1 object and second argument 'line2' goes to L2 object.
      # if m1 is equal to m2, the two lines will not intersect
      # m1 = - A1/B1, m2= -A2/B2

  • @ish8591
    @ish8591 Год назад

    24:45 sir hume 4th scenario k liye line class kyu bnani padi method nahi bna sakte the?

  • @akhilp6263
    @akhilp6263 Год назад

    🥰😊Thank you

  • @dibyendusasmal
    @dibyendusasmal Год назад +2

    sir how I add multiple fractions. can you help me, please

  • @dibyendusasmal
    @dibyendusasmal Год назад +1

    1:29 - sir you just tell the amount, at first we need to check the pin

  • @user-uu9zq2qo8j
    @user-uu9zq2qo8j 11 месяцев назад

    java vs python story was best

  • @Hariskhan-uu6tu
    @Hariskhan-uu6tu 16 дней назад

    that's why companies are not hiring freshers 😅

  • @ankitgupta1806
    @ankitgupta1806 4 месяца назад

    thnk u mera naam use krne ke liye

  • @dheerajgiri2269
    @dheerajgiri2269 Год назад

    sir, I have an Doubt.
    what if I want to create an instance variable name "__account__holder_name" as a private data then if i used like these "self.____account_holder_name" --> it does not prodcues any error ??? becuase the variable name contained the double underscore and when I using it with self.__ then it beome four time underscore then it will produce an error ????? anyone ??

  • @rikeshdatascientist
    @rikeshdatascientist 5 месяцев назад

    1:39:01 esa bhi kya chhupana jo, chah ke bhi nhi chhup rha😂

  • @MKSundaram
    @MKSundaram Год назад

    @1:00:34 why function greet(person) has person with lower case not in PascalCase? but the program executes as expected. So I am confused about it. If anyone could help me clear doubts, that would be great. Thanks

    • @MKSundaram
      @MKSundaram Год назад

      I got it. I was confused as the parameter and our class name was same. the parameter in greet is just the name and it could have been any name. Sir, user person so that we would know that the object coming is type

  • @rajaneeshray7502
    @rajaneeshray7502 Год назад

    code for fix the pritning issue of line eqution //
    class Line:
    def __init__(self, A, B, C):
    self.A = A
    self.B = B
    self.C = C
    def __str__(self):
    Ax = ""
    By = ""
    Cc = ""

    if "-" in str(self.A):
    Ax = "-{}x".format(self.A)
    else:
    Ax = "{}x".format(self.A)
    if "-" in str(self.B):
    By = "-{}y".format(self.B)
    else:
    By = "+{}y".format(self.B)
    if "-" in str(self.C):
    Cc = "-{}".format(self.C)
    else:
    Cc = "+{}".format(self.C)
    return "{} {} {}".format(Ax, By, Cc)

    • @rajaneeshray7502
      @rajaneeshray7502 Год назад

      class Line:
      def __init__(self, A, B, C):
      self.A = A
      self.B = B
      self.C = C
      def __str__(self):
      Ax = ""
      By = ""
      Cc = ""
      if self.A < 0:
      Ax = "-{}x".format(abs(self.A))
      else:
      Ax = "{}x".format(self.A)
      if self.B < 0:
      By = "-{}y".format(abs(self.B))
      else:
      By = "+{}y".format(self.B)
      if self.C < 0:
      Cc = "-{}".format(abs(self.C))
      else:
      Cc = "+{}".format(self.C)
      return "{} {} {}".format(Ax, By, Cc)

  • @yatinshekhar787
    @yatinshekhar787 4 дня назад

    17/140

  • @mohammednihad9818
    @mohammednihad9818 3 месяца назад

    any one know ? that why sir dislikes ByJu's😅😅😅

  • @gameking2447
    @gameking2447 9 месяцев назад

    sir roasted byjus

  • @3mixmusic564
    @3mixmusic564 Год назад

    Sir kya hua Byju's naam aate hai aap ka mood chng ho jata hai

  • @ish8591
    @ish8591 Год назад

    1:12:00 sir mujhe ye concept clear nahi hua....

  • @umasharma6119
    @umasharma6119 Год назад

    🔥🔥🔥

  • @sumeetsheokand8886
    @sumeetsheokand8886 Год назад

    sir i am unable to open your website

  • @apurbakumarmajumder9478
    @apurbakumarmajumder9478 Год назад +1

    sir how to access doubt support

    • @campusx-official
      @campusx-official  Год назад

      Check membership tab. We have shared a google form there. You can fill the doubt there. Our team will contact you over email

  • @osho_magic
    @osho_magic Год назад

    How to join this full course

  • @parvesmaurya2554
    @parvesmaurya2554 Год назад

    What his website?