#51 Python Tutorial for Beginners | Constructor, Self and Comparing Objects

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • Check out our courses:
    Spring and Microservices Weekend Live Batch : bit.ly/spring-...
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : bit.ly/java-sp...
    For More Queries WhatsApp or Call on : +919008963671
    website : courses.telusk...
    Instagram : / navinreddyofficial
    Linkedin : / navinreddy20
    TELUSKO Android App : bit.ly/TeluskoApp
    Discord : / discord
    Python Tutorial to learn Python programming with examples
    Complete Python Tutorial for Beginners Playlist : • #1 Python Tutorial for...
    Python Tutorial in Hindi : • #1 Python Tutorial | I...
    Java and Spring Framework For beginners with Spring Boot : - bit.ly/3LDMj8D
    Java Tutorial for Beginners (2023) :- bit.ly/3yARVbN
    Editing Monitors :
    amzn.to/2RfKWgL
    amzn.to/2Q665JW
    amzn.to/2OUP21a.
    Subscribe to our other channel:
    Navin Reddy : www.youtube.co....
    Telusko Hindi :
    www.youtube.co....
    Donation:
    PayPal Id : navinreddy20
    Patreon : navinreddy20
    www.telusko.com...

КОМЕНТАРІ • 398

  • @harish7548
    @harish7548 4 роки тому +56

    In 2016-17 learned java just by watching your videos got job and now these (company) guys want me to learn Python ...I was like not an issue navin is there you are always there for me ..the only one I really felt like professor for me

    • @Uplift_001
      @Uplift_001 4 місяці тому

      Hello sir ,
      Can you tell me that if I learn only python will I get a work from home job of ₹30 per month?

  • @newgoblin49
    @newgoblin49 5 років тому +162

    I'm not going to watch the entire thing but I have to say that your videos are extremely good. I haven't seen anyone else take the time and effort how you have taken

    • @deepaksodhi1395
      @deepaksodhi1395 4 роки тому +1

      true..!!

    • @jeetenderkakkar7570
      @jeetenderkakkar7570 3 роки тому +1

      1000

    • @pandu7820
      @pandu7820 2 роки тому

      We are saying c1.update() that means from this we can say we want to change the c1 (object1) then why we need self
      Pls help me

    • @newgoblin49
      @newgoblin49 2 роки тому

      @@pandu7820 stfu, I already cleared engineering and I’m working now and you’re asking me all this ?

    • @rajatverma3692
      @rajatverma3692 2 роки тому

      @@pandu7820 bhai c1.update() ka matlab hi yhi hai ki update ko call kr rhe hain ham aur c1 object as a parameter ja rha hai usme..... To jaha kahi bhi update function hai waha pe object type ka parameter hona chahiye to take input via argument ....to usko accept krne ke lie self lagana pada

  • @bloke3253
    @bloke3253 5 років тому +78

    Thank you for explaining so well without any fee 🙌🙌.

  • @mohankumar-fm1kg
    @mohankumar-fm1kg 4 роки тому +30

    wow your lectures made me toooo addicted to python, expecting more videos for different libraries in pythoon!

  • @harithareddy1731
    @harithareddy1731 5 років тому +20

    I never like any coding...Once I started your watching your videos it seems very easy for me...Very talented Sir ...Your teaching was really awesome:)

  • @harishthalluri211
    @harishthalluri211 5 років тому +5

    I had no idea what a class does so far. But now I can quickly visualize what it does in the computer. You been so helpful by explaining the stuff in detail(basics). Thanks a lot.

  • @ArmanKhan-tx4gi
    @ArmanKhan-tx4gi 5 років тому +14

    Hands down , the best python tutorial i've ever came across.

  • @mahajanvansh
    @mahajanvansh 5 років тому +11

    I have seen all your lectures of this playlist and I must say I feel confident in python. Thank you so much for all the efforts you have put in to teach newbies like us. It is well deserved for great appreciation. Thank you, again. :)

  • @adwaithrajesh596
    @adwaithrajesh596 5 років тому +19

    if someone asked me "who Is your hero". I will say its Navin Reddy sir , The person who inspired me... Thank you so much sir... You are a hero..

  • @priyakaul31
    @priyakaul31 5 років тому +5

    i have been studying python from some really good books. but your explanation of classes and all the concepts related like objects, init, constructor is to the point and just so well conveyed.

  • @bapunmalik3747
    @bapunmalik3747 4 роки тому +1

    i am a beginner in your tutorial and i have no experience in programming as i am a physics student.during each video of your i learn something and also able to create.i have made a area calculator and some simple stuffs........thanks sir for your coaching for without any fee.....i will always grateful to you

  • @BoomcoreIsLive
    @BoomcoreIsLive 5 років тому +14

    Wow!!! Very clear explanation... Thank you so much Navin Sir.

  • @fhdhejeh63
    @fhdhejeh63 5 років тому +9

    Things are starting to get a bit complicated but still your way of explaining things just makes it easier. Thank you sir.

  • @nipuntiwari5517
    @nipuntiwari5517 4 роки тому +8

    Hello sir. I am Nipun Tiwari and I am 11 years old. Sir I watched your whole series last year and learned Python and now I am learning Java series. I must admit sir that you are the best teacher in the world because you can teach a naughty child like me to young and old people. We all aliens love you sir. Please continue making more videos. Once again thanks a lot sir and we love u sir.

  • @stewardjames1772
    @stewardjames1772 5 років тому +3

    class mine:
    def __init__(self):
    self.yam = int(input("enter an integer"))
    def compare(self,other):
    if self.yam == other.yam:
    return True
    else:
    return False
    paa = mine()
    yam = mine()
    if paa.compare(yam):
    print("they are the same")
    else:
    print("they are different")
    hi! so i did this, just to compare two different integers... and it worked so cool. .... Thanks man. God bless you.

  • @bhadjarahul2285
    @bhadjarahul2285 6 років тому +8

    you are very talented sir , i love python, your teaching skill is 100/100 .

  • @hardishah3442
    @hardishah3442 3 роки тому +1

    Watched many videos and just your 1 video made all my concepts clear.. so thankful to u!!!

  • @carlosvenegas8981
    @carlosvenegas8981 4 роки тому +9

    Thank you wish I could have you as a instructor!

  • @faizrock5659
    @faizrock5659 4 роки тому +1

    if i had seen this last to last year.....i wouldn't have paid a dime to online platforms......these are the best

  • @kunalpatel8496
    @kunalpatel8496 13 днів тому

    Thank you !! You have explain the concept in an understandable way.

  • @shobhitpandey8821
    @shobhitpandey8821 4 роки тому +2

    After watching your videos every Concept become crystal clear,thanks for your Incredible effort, even one cannot understand these stuff by joining so called coaching Institute.🙏

  • @piyushpatil2668
    @piyushpatil2668 3 роки тому +1

    I used to hate OOPs, but now I changed my mind just because of you sir.
    Keep up the good work. You're the best.

  • @mailsidney
    @mailsidney 2 роки тому +1

    Thank you so much for your videos. They make learning easy. I am an amateur programmer but always struggled with the "self" concept. Finally a instructor who can explain it well. Subscribed to your channel.

  • @MukilShelby
    @MukilShelby 4 роки тому +4

    The only useful thing I am doing in this lockdown is watching your videoz 🌹

  • @msms3260
    @msms3260 4 роки тому +1

    Greatly helpful! Please don’t stop making these videos ever. From looking at the comments obviously you are doing a great service. May God bless you.

  • @shyamananth
    @shyamananth 5 років тому +1

    I have not seen someone explaining the 'self' keyword better than this... Not even the paid tutorials... Thanks a lot !!!

  • @raghav4858
    @raghav4858 4 роки тому +4

    Here is the one liner ,Sir mentioned at 9:40
    compare= lambda self,c:(self.memory==c.memory)

  • @shivendrarajawat9517
    @shivendrarajawat9517 4 роки тому

    Hey, this guy is genius, master, great teacher, I know python and I have read many books in python, but what he explained in last 11 minutes I have to read 2 to 3 books and spent time on internet to learn the same .. new learners must watch his videos...I am overwhelmed...great

    • @shivendrarajawat9517
      @shivendrarajawat9517 4 роки тому

      Naveen Sir, please explain __new__ with __init__ as new is constructor and init is initializer in python.

  • @Kennensiemich
    @Kennensiemich 3 місяці тому

    you only emphasize on the exact point of the subject!!! Bravo 👌👨‍💻

  • @harshsrivastava6591
    @harshsrivastava6591 4 роки тому +3

    Thank you sir for this explanation on classes and objects, I went to various resources but nobody explained these concepts like you did.

  • @voice.ofAishu
    @voice.ofAishu 4 роки тому +1

    Thanku so much for your valuable classes sir.... How simply your teaching style.... 🤝❤

  • @arunpandian9606
    @arunpandian9606 4 роки тому +8

    Got a Wonderful Lectures from you.. Keep doing well..

  • @rakeshsanthapuri9933
    @rakeshsanthapuri9933 5 років тому +1

    Love you sir...
    First i didn,t understand any thing .
    Later when i put on paper,as a beginner,its amazing........

  • @akshaybaburaj6837
    @akshaybaburaj6837 Рік тому +1

    Sir your way of explanation is top class ! Totally made the concepts clear. Thank you

  • @theneverwas2835
    @theneverwas2835 3 роки тому

    You said it perfectly in two words, it is the "current instance." That helps me visualize it better now than I could before. Thank you.

  • @chinmaydas4053
    @chinmaydas4053 6 років тому +4

    Sir many thanks for reminding and answering my name & question 🙏🙏..

  • @Sumit-cz9fm
    @Sumit-cz9fm 2 роки тому

    I was unable to understand constructors for very long time..now it seems clearer...thanka

  • @ankitaggarwal4260
    @ankitaggarwal4260 4 роки тому +44

    Rasode mai kon tha?
    Answer- 5:00
    😂😂

  • @AnilKumar-pp2yo
    @AnilKumar-pp2yo 5 років тому +8

    Love how you mess up sometimes using java syntax xD.. but great videos bro ! Extremely helpful

  • @054_ritesh3
    @054_ritesh3 4 роки тому +1

    Awsome explanation sir

  • @sivasurya4149
    @sivasurya4149 4 роки тому

    U r best for teaching of phyton.... . No badii like u way of teaching sir..

  • @imanolvazquez9146
    @imanolvazquez9146 5 років тому +5

    Sir you are a Master, a crack a GOD ty so much

  • @sandeelg_lite
    @sandeelg_lite 4 роки тому

    I know there are many cuts and takes in your videos. But the pace you maintain doesn't make listeners get bored.

  • @amruth6681
    @amruth6681 4 роки тому

    Man you made me addicted to your voice and python... Great job with no fees you are awesome teacher

  • @ABMA79
    @ABMA79 4 роки тому +2

    your effort to explain is more than amazing, but I am still struggling to understand the concept of classes and objects, I come from OPP environment, object procedural programming, completely different from OOP, object-oriented programming.
    So please explain more about classes and objects and it will be more than enough if you can illustrate through using an example.
    Thanks a lot and I hope to watch that tutorial soon.

  • @vasavihegde5186
    @vasavihegde5186 2 роки тому

    Omg! Love the way you explain!!! Never felt this good after watching any python tutorial.

  • @santiswaroopa3262
    @santiswaroopa3262 3 роки тому

    you are God of Computer knowledge , Thanks a lot

  • @chetansoni8620
    @chetansoni8620 3 роки тому

    That compare method gives a good explanation about self. Thanks for explaining.

  • @fcnealvillangca7943
    @fcnealvillangca7943 5 років тому +1

    good explanation and your pronunciation and accent makes your video exciting

  • @neomuks
    @neomuks 4 роки тому

    i was very confused on how self work and why we have to pass it but your way of explaining made it easy for for me and i think 125700 viewers.

  • @CarloPiana
    @CarloPiana 11 місяців тому

    This is sort of enlightening. Eye opener. Thanks.

  • @sns2451
    @sns2451 3 роки тому

    I liked the approach you lectured the concept. It is good. It helped me to understand. Thank you.

  • @vakhariyajay2224
    @vakhariyajay2224 2 роки тому

    Thank you very much. You are a genius.

  • @ashrafulalim1272
    @ashrafulalim1272 5 років тому +1

    Well explained within a short time. Thank you.

  • @chinmayeeojha1108
    @chinmayeeojha1108 3 роки тому

    Thank u so much...its extremely good..

  • @shivanipalav3038
    @shivanipalav3038 3 роки тому

    I was literally confused what does self do by watching ur video my confusion got cleared.Thank for explaining so well.

  • @Rudra-go6us
    @Rudra-go6us 3 роки тому

    another awesome video. great. thank you.

  • @swapnilborude1412
    @swapnilborude1412 3 роки тому

    The videos are far better than any course.learnt a lot

  • @marshall7253
    @marshall7253 5 років тому +2

    You're awesome at explaining man, thanks.

  • @mrigankchugh2096
    @mrigankchugh2096 5 років тому +1

    your videos are awesome, really appreciate the time you have spent to explain this concept to beginners

  • @shubhamgohel4647
    @shubhamgohel4647 2 роки тому

    best tutor on youtube.
    one request can you please upload or teach live projects on python

  • @abhinaba__saha
    @abhinaba__saha 4 роки тому

    great concept to puzzle the brain

  • @papo7936
    @papo7936 Рік тому

    Great video as always. There seems to be an important point missing: there is a __eq__ method that classes can implement and with which they can define the behavior of the equality operator ("==").

  • @alpapatel5182
    @alpapatel5182 4 роки тому +1

    I didn't got everything but I got something from this video
    Thx

  • @storyofstories6341
    @storyofstories6341 2 місяці тому

    Best explanation ever

  • @kajalvarshney427
    @kajalvarshney427 5 років тому +1

    Amazing explanation.....

  • @JatinKumarJKM
    @JatinKumarJKM 3 роки тому

    god bless you and your dear ones navin sir

  • @SoulBoxer.
    @SoulBoxer. 4 роки тому

    Your videos and efforts are great

  • @chandu0771
    @chandu0771 4 роки тому

    very good.. it's easy to compare with java.. because i was learned java also

  • @pravirkumar2712
    @pravirkumar2712 4 роки тому

    Sir ur way of teaching is as beautiful as 💎

  • @sheikhakbar2067
    @sheikhakbar2067 4 роки тому

    One of the best explanations with regard to OOP!

  • @debjyotibanerjee7750
    @debjyotibanerjee7750 4 роки тому

    Really good explaination, understood the concept easily

  • @shivanshuudeniya3338
    @shivanshuudeniya3338 5 років тому

    I have to say this you are great at teaching...............

  • @chessbd
    @chessbd Рік тому

    Things are getting complicated but still, it is the best explanation so far!

  • @SamimHossain-hi9fn
    @SamimHossain-hi9fn 3 роки тому

    Nice explanation
    Love you ❤ sir

  • @ArunNalluri
    @ArunNalluri 5 років тому +1

    Thanks for clarifying these concepts! are they same in Java as well??

  • @ArjunKalidas
    @ArjunKalidas 5 років тому +1

    At 7:34, you are explaining about c1.Computer() and you were saying how will the compiler know which object I am referring to. It is obviously c1 right. Unless I am calling by Computer.update(), I have to define by saying Computer.update(c1).

  • @rajeshvarma2162
    @rajeshvarma2162 3 роки тому

    you are the best tutor in india

  • @kosmic000
    @kosmic000 6 років тому

    amazing description thank u for making it so clear wit examples

  • @prakashkancharla299
    @prakashkancharla299 4 роки тому +1

    We can compare by
    If c1.age==c2.age:
    print("they are same")
    Without defining compare cunction

    • @sohamn2823
      @sohamn2823 4 роки тому

      yes i also had the same doubt

  • @coenkoole5897
    @coenkoole5897 3 роки тому

    bro i was looking for this comparing everywbere! Thanks for the help!

  • @raptyaxa5771
    @raptyaxa5771 4 роки тому +1

    I always thought that object's variables are encapsulated, that they will always reference to itself first. I never knew that it has to be coded explicitly.

  • @doflamingo1810
    @doflamingo1810 3 роки тому +1

    Bro,while comparing what can we do if there are more than two objects ?

  • @sanjeevkumar-ty8dx
    @sanjeevkumar-ty8dx 4 роки тому

    C1,&C2 ...r ..reference type ,so they will store on Stack,and Objects r stored on Heap(here,--computer) if i m not wrong

  • @sultansaleem5651
    @sultansaleem5651 4 роки тому

    Great video sir you explained every thing with absolute simplicity and I have got the true idea of self
    Again thank you sir for this amazing python series🙏

  • @aakashgupta2832
    @aakashgupta2832 4 роки тому

    Awesome video sir ji

  • @theyaghu
    @theyaghu 5 років тому

    This video is very useful

  • @easylearninghindi
    @easylearninghindi 4 роки тому

    All concepts are cleared.

  • @rishichaturvedi3620
    @rishichaturvedi3620 4 роки тому

    very good explanation. really needed this video.

  • @kwenamartinkgowa2554
    @kwenamartinkgowa2554 Рік тому

    Using a function in a condition could be confusing for first time programmers, under the impression that this tutorials are for first time programmers.
    Rather introduce a variable that will hold the results from the compare method then use that variable in the condition. Yes it will take 1 or 2 more lines and more memory but for explaining purpose it makes thing more simpler. Love the videos by the way

  • @aashishmalhotra
    @aashishmalhotra 2 місяці тому +1

    Thanks!

    • @aashishmalhotra
      @aashishmalhotra 2 місяці тому

      Thanks for your contribution in community.

  • @satyajaiswal7372
    @satyajaiswal7372 6 років тому +5

    Hi naveen,
    Whats the use of self in that update method when called by c1.
    If update method is called from object c1 then it implicitly means c1 is calling ..No need of self

    • @akshatagaonkar4788
      @akshatagaonkar4788 5 років тому

      I also have same question

    • @albertmusayev5343
      @albertmusayev5343 4 роки тому

      Yes , you are right , self is implicit , when c1 calls , the function put c1 in self and then do operations with others .

  • @manuelalejandrohermoso4713
    @manuelalejandrohermoso4713 4 роки тому

    Very helpful! now I got it!

  • @MrHmm-cv6gs
    @MrHmm-cv6gs 4 роки тому

    _init_ gives the objects attributes or variable.
    whereas update(), compare() were two methods or functions which works on objects.
    and self here represents the objects it self,who is calling function.

  • @IndianKhanaa
    @IndianKhanaa 2 роки тому

    Hello Navin, thank you for wonderful training in Python. It is helping me a lot.
    I have a question, when we are writing functions and calling them , why do we need to create class and object? OOPs concept is always confusing to me :)

  • @omkarjadhav848
    @omkarjadhav848 2 роки тому

    Thank you sir.

  • @nazrulhassan6310
    @nazrulhassan6310 5 років тому

    hey naveen I had hard time comprehending this 'self' thing but you helped me understanding it thanks

  • @aniruddwakikar3004
    @aniruddwakikar3004 4 роки тому

    Just one word ...GENIUS

  • @sykconsultancy3024
    @sykconsultancy3024 5 років тому

    Very nice explanation again.

  • @okly
    @okly 4 роки тому

    GOOD EXPLANATION