#63 Python Tutorial for Beginners | Exception Handling

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024
  • Check out our courses:
    Spring Boot and Microservices Live Course : go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    Complete Java Developer Course Batch-3: go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    Enterprise Java Spring Microservices: go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : go.telusko.com...
    Coupon: TELUSKO20 (20% Discount)
    Udemy Courses:
    Spring: go.telusko.com...
    Java:- go.telusko.com...
    Java Spring:- go.telusko.com...
    Java For Programmers:- go.telusko.com...
    Python : go.telusko.com...
    Git : go.telusko.com...
    Docker : go.telusko.com...
    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...
    Github :- github.com/nav...
    Java and Spring Framework For beginners with Spring Boot : - bit.ly/3LDMj8D
    Java Tutorial for Beginners (2023) :- bit.ly/3yARVbN
    Subscribe to our other channel:
    Navin Reddy : / @navinreddy
    Telusko Hindi :
    / @teluskohindi

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

  • @sahej97
    @sahej97 5 лет назад +53

    Sir your teaching style is innovative and the tidbits that you say in-between is what makes you a great teacher.
    I've been taught by many teachers and I can say the level at which teach, for which other teachers get paid a lot, but you deliver all this for free is commendable.
    Thank you very much Sir for rejuvenating my passion for Python.

  • @srikanth-ry8lp
    @srikanth-ry8lp 4 года назад +32

    mamulu racha kadu, I was almost ready to pay for python classes and i found this channel. THE BEST channel to learn coding.

  • @aryanfalke5751
    @aryanfalke5751 4 года назад +65

    I literally learned the entire python language through your videos. Tysm for great videos and simplified explanation

  • @vojtechbrecka201
    @vojtechbrecka201 3 года назад +6

    So I am slowly approaching the end of your Python course, Sir, and I have to thank you. I have started just a few weeks ago as a total beginner, and because of you, I can now write a simple applications, and (and that's most important) I can think as a programmer which made learning other languages a lot easier for me. Thank you, Sir Navin Reddy

  • @sam.mankar
    @sam.mankar 4 года назад +102

    Telusko = 1
    Navin_Reddy_Sir = 100
    try:
    print("Telusko + Navin_Reddy_Sir")
    except:
    print("you don't have any errors, Sir.")
    finally:
    print("you are still the best")

  • @ShoaibKhan0701
    @ShoaibKhan0701 4 года назад +69

    Itna to college wale bhi nahi karate jitna navin ji samjha dete h ❣️❣️❣️

  • @AshrafulHussainKhan
    @AshrafulHussainKhan 3 года назад +6

    It was always confusing for me about the error handling. You made it crystal clear today. I like your simplicity in teaching complex concepts.

  • @akashsahni9407
    @akashsahni9407 6 лет назад +188

    Mr Perfect = Navin Reddy Sir

    • @Busy_mind24
      @Busy_mind24 2 года назад +1

      Python=Navin reddy sir💕

  • @jindaldreams
    @jindaldreams 4 года назад +4

    Great explanation.
    Also I like all your catch phrases. Eg, "Hold on" and "For those with Java, C++ background will be familiar with this" and "You might be wondering" and "What would happen if" and "Oh thats weird, what if i do this.."

  • @giuseppepala8668
    @giuseppepala8668 5 лет назад +6

    "The general doctor" 👍
    Nicely put. My compliments!

  • @attilapaucsa4875
    @attilapaucsa4875 3 года назад +4

    Thank you very much for this tutorial! It was that part of coding what I have never understood exactly, until I've seen your video!

  • @danielkamau8436
    @danielkamau8436 4 года назад +3

    A good class that can easily confuse if one is not careful.....otherwise you are Mr Good in this field, as a starter, I feel challenged to when I will be there. Again thanks to my classmates because the comments we write here are also resourceful by far when I read, understand and
    run them, I get informed of extra things. Big up guys.

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

    You really have a knack for teaching ...brilliant

  • @054_ritesh3
    @054_ritesh3 4 года назад +2

    I have started loving python because of your teaching sir hats off to you🙏🙏🙏🙏🙏

  • @priyasoni4531
    @priyasoni4531 4 года назад +3

    Sir you are great with thier easy explanation.i learn most of the thing in python for your channel .it is very good and easy to understand.
    Thank you sir...

  • @andressaa2180
    @andressaa2180 4 года назад +5

    You're a great instructor, thanks for sharing these concepts in a way that beginners can actually understand :)

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

    very crisp explanation. Small and simple examples which I was easy to get an understanding, i.e the fridge concept= open a door take a bottle then close it.

  • @karthick2237
    @karthick2237 5 лет назад +3

    The best video for Exception handling in RUclips. Nailed it sir.

  • @rahulprasadsingh2639
    @rahulprasadsingh2639 4 года назад +2

    a=5
    b=2
    try:
    print("resource open")
    print(a/b)
    k=int(input("enter a number"))
    print(k)
    except ZeroDivisionError as e:
    print("Hey, you cannot divide a number by zero",e)
    except ValueError as e:
    print("Invalid input", e)
    except Exception as e:
    print('something went wrong...',e)
    finally:
    print('resource closed')

  • @sujalsubramani1543
    @sujalsubramani1543 2 года назад +1

    u made easier sir better than my teachers or frnds thanks a lot

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

    Navin your videos are amazing.
    Navin, please specify else block as well. i.e, try block for checking any error, except block will handle the error, else block will execute if there is no error, and finally block will excecute regardless the result of try and except block.

  • @RavikanthTalakoti
    @RavikanthTalakoti 4 года назад +2

    Nice videos Navin sir
    These are very helpful to me. Thank you a lot for your hard work.

  • @robo_tech
    @robo_tech 4 года назад +1

    Navin Sir I am just a 15-year-old kid interested in programming. In school, we are taught JAVA language. I know the basics but still, you teach so well that in my 10th grade currently sitting at home during the lockdown I stay awake until 11:00 pm after completing the studies just because u teach with so many interesting real-life examples. So just love the way u teach. I have watched 63 videos in 8 days. I am really enjoying. Thank u!!!!!!!!

    • @robo_tech
      @robo_tech 4 года назад

      @Aanshumaan Shrijai VII C Roll No. 37 Thats Good!! I was told one thing you know by one of my connections on LinkedIn just to motivate you here is the thing:
      Udit Rathod
      You should explore never stop exploring ... just keep in mind you have to be Dora the explorer because that's what I do.
      That's the man UDIT RATHOD who told me pretty inspiring things!! If possible connect with me on LinkedIn we can discuss a lot of things!! You can also get ideas from me we can exchange challenges lot more.

    • @robo_tech
      @robo_tech 4 года назад

      @Aanshumaan Shrijai VII C Roll No. 37 Then how can we be in contact?

  • @madhavaprashath1453
    @madhavaprashath1453 5 лет назад +6

    i wish i had a teacher like u in my school!!!!!!!!!!!!

  • @Jdjdhsgxuxu
    @Jdjdhsgxuxu 2 года назад +1

    You’re the best teacher in the world. Tutors in Udemy should take note from this lovely man.

  • @rezamostafid8810
    @rezamostafid8810 2 года назад +1

    Hi Navin,
    you throw in a lot motivational points and give us a very clear picture of what exceptions are, why you might need them and you provide basic usage of the python 'try'-'except' construct. Very well done! Now I feel fully prepared to try out some examples myself ( which I have already ...) as well as explore the nitty gritty details in the python documentation for specific applications and problems. WELL EXPLAINED, WELL DONE and THANK YOU!!

  • @navinn.luthrianavinn.luthr9532
    @navinn.luthrianavinn.luthr9532 3 года назад +2

    Hello Sir your way of teaching and the presentation is amazing 👍👍

  • @t11oaa8
    @t11oaa8 3 года назад +2

    Can I like this a million times? Thank you Telusko!

  • @codex8332
    @codex8332 4 года назад +2

    The most intriguing and easy going class so far

  • @philipdaseh9745
    @philipdaseh9745 4 года назад +2

    You are a very good teacher, the way you explain with simplicity is awesome.

  • @сойка-и8й
    @сойка-и8й 6 лет назад +9

    Sir...thank you for your python beginners tutorials...sir are you going to upload videos on python frameworks and advanced libraries... Like sckit learn numpy opencv etc..? please let me know sir...

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

    I m learning python 1st time from your Chanel .. it’s really helpful ..thank you sir

  • @ParthTagalpallewar
    @ParthTagalpallewar 3 года назад +1

    Sir your videos clearly shows you interest in learning new techs and the deep knowledge you have

  • @s.abirami8394
    @s.abirami8394 2 года назад

    Everytime I view your tutorials I just make sure make sure to click that big fat like button and I move to watch that video you're simply awesome it's just a crystal clear thankyou sir

  • @rahilahmed2192
    @rahilahmed2192 3 года назад +1

    Great teaching style sir all doubts are clear👌👌👍👍👍👍🎂

  • @rudriacharya7344
    @rudriacharya7344 2 года назад

    i was struglling with this topic from long time. u made it just like clear water. thank u

  • @neerajmythink
    @neerajmythink 3 года назад

    Phenomenal explanation... This guy doesn't throw unhandled error.

  • @karthick9408
    @karthick9408 3 года назад +6

    A good teacher doesn't need a whole day for any good concept simply this much time is enough
    Thank you sir 👍

  • @amalal-suhaimi9810
    @amalal-suhaimi9810 5 лет назад +1

    u r great .. i got ur explanation from a first time without repeat the video 😍 thank u so much ❤️

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

    sir ,you have versatility in the teaching and i am lucky to see this channel

  • @Imran20091990
    @Imran20091990 2 года назад

    It's always good practice to write specific exception which we aware. If we don't know what kind of error will occur then Parent Exception.. Taught by Naveen Automation Labs.. same theory by Naveen Reddy.. Both were awesome in teaching.. 👍👍👍

  • @JahanzaibNiazi
    @JahanzaibNiazi 3 года назад

    You have cleared that concept of try and catch in a best possible way. I was lot of confused in that exception topic but you have cleared the every thing. hats off to you sir. And your way of teaching is absolutely excellent.

  • @mrcreations1033
    @mrcreations1033 3 года назад

    Sir 🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻The way you are teaching 👌🏼👌🏼👌🏼👌🏼NAA buthoo na bavishyath🤝🤝🤝🤝✊✊

  • @yaweli2968
    @yaweli2968 2 года назад

    This is how you teach. keep it basic/simple. Thanks, great job.

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

    your explanation is great sir. understood the whole concept clearly
    thank you

  • @ankitkumaryadav562
    @ankitkumaryadav562 3 года назад

    Very nice and clear explanation. the main thing is it's a very short video as compare to other creater.

  • @jaitiwari241
    @jaitiwari241 6 лет назад +1

    Thanks and appreciate you Sir for ur effort. I have the same question which Abhi asked. Will you upload videos on NumPy, pandas and other libraries. How much python knowledge we should require to get started with a job in python? Do we require knowledge of all libraries and framework like Django, pylons? To start a job in python what we skillset do we actually require in python. Please guide SIR..Thanks a lot

  • @tannusharmaxiib3637
    @tannusharmaxiib3637 5 лет назад +3

    Nice explanation sir.... Thank u so much🤗

  • @adarshtiwari7395
    @adarshtiwari7395 4 года назад +1

    This was so much effective for my learning. It helped a lot. Effortless teaching

  • @ragasudha24
    @ragasudha24 3 года назад

    Fridge example 👏🏻👏🏻 is very practical
    Thank you Sir!!

  • @SurajSuresh007
    @SurajSuresh007 5 лет назад +24

    what is the need of finally: if we can just print('resource closed") outside will that make sense?

    • @donha475
      @donha475 5 лет назад +3

      I thought the same but it does look tidier to the eye... as a logical block of code before embarking on some other idea... kind of like paragraphs in writing prose...

    • @aryanfalke5751
      @aryanfalke5751 4 года назад +10

      If you do not have the finally clause and you get an error the file won't close. Finally ensures that regardless of the errors taking place in the program , it would perform the task mentioned.

    • @BerozgaarIAS
      @BerozgaarIAS 4 года назад +2

      @@aryanfalke5751 i think that u had failed to understand the question correctly. he is asking that what is the need of finally, if we just simply put the 'resource closed' statement outside all the blocks of try and except.

    • @raodyc
      @raodyc 4 года назад +8

      Let just say in your except block you mentioned only 1 type of error ( Value error) and when you run the code you divided any number with 0
      In that case the "resource close" statement not going to run
      Finally: ensure that every last block of code execute even if there are multiple errors

    • @RockIT1
      @RockIT1 4 года назад +1

      *See if you write 'resource closed' outside then it will get printed only when there is not an error because the execution stops when there is an error previously*

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

    I love your teaching style, clear and and easy to understand

  • @koollguyy
    @koollguyy 3 года назад

    Great examples Naveen. The doctor and fridge comparisons really made it easy to understand!!

  • @ramanak2213
    @ramanak2213 4 года назад

    as you always mentioning about it, i will learn java after completion of this course, for sure.

  • @devil_5678
    @devil_5678 5 лет назад +2

    I understand this topic only by ur video, thanks a lot

  • @shubhamgohel007
    @shubhamgohel007 2 года назад +5

    Navin sir :- God of Programming for me.....Helped me get through interview and many concept 😘

  • @avijitmazumder6314
    @avijitmazumder6314 2 года назад

    Amazing Teaching skill. God bless you sir.

  • @11maid11
    @11maid11 6 лет назад +2

    Amazing work there, will you be making tutorials of creating GUI in python?

  • @anshi6205
    @anshi6205 4 года назад

    I learnt all python by you... thank you so much....very helpful videos for me...

  • @GaneshPrema
    @GaneshPrema 5 лет назад +1

    Very clear explanation Sir...Thanks a Lotttttttttttttttttttt Sir

  • @RockIT1
    @RockIT1 4 года назад +1

    *Best video in this topic*
    Thank You Sir

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

    Awesome tutorial. Once you catch the source of the error and get the message, the next step you need to deal with or handling it. How do you go about it????

  • @narangparth
    @narangparth 4 года назад +1

    Hi Navin,
    As you mentioned, if we want some piece of code irrespective of whether an exception was caught or not, then, we use finally block.
    So, wanted to ask, what if we don't use finally block and instead write that piece of code post our except block. Then too, our piece of code will execute whether or not an exception was caught or not.
    Will there be a difference? if yes, what's the benefit of using finally block instead of writing that code after except block?
    Example with finally block:
    a = 5
    b = 0
    try:
    print("DB connection started")
    print(a/b)
    except Exception as e:
    print("Exception caught !!", e)
    finally:
    print("DB connection closed")

    The same example without finally block:
    a = 5
    b = 2
    try:
    print("DB connection started")
    print(a/b)
    except Exception as e:
    print("Exception caught !!", e)
    print("DB connection closed")

    • @vjnimbalkar
      @vjnimbalkar 3 года назад +1

      Since you have given the Exception keyword, it will handle all the exceptions. Try this:
      a = 5
      b = 0
      try:
      print("DB connection started")
      print(a/b)
      except ValueError as e:
      print("Exception caught !!", e)
      print("DB connection closed")
      In the above case the print("DB connection closed") statement would never run. but now try this and the print("DB connection closed") always runs even if any error occurs.
      a = 5
      b = 0
      try:
      print("DB connection started")
      print(a/b)
      except ValueError as e:
      print("Exception caught !!", e)
      finally:
      print("DB connection closed")
      Hopefully it made sense now

    • @narangparth
      @narangparth 3 года назад

      @@vjnimbalkar thanks Vijay. It helped.

  • @sairamgogu4081
    @sairamgogu4081 5 лет назад +1

    Tqq so much sir. You nailed it.i didn't understood this concept java but you made it clear in Python

  • @Praveen-qs4ch
    @Praveen-qs4ch 3 года назад

    Thanks for giving free excellence course for all

  • @jitendraraghuwanshi1365
    @jitendraraghuwanshi1365 5 лет назад +1

    Best video so far

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

    Simply simplified my doubt

  • @gamestv4875
    @gamestv4875 3 года назад

    I like the way you explain things.
    Nice video

  • @ShyKaiju
    @ShyKaiju 4 года назад +3

    thank you so much, i was able to figure out my hw because of this video

  • @Perplexedsouvik
    @Perplexedsouvik 4 года назад

    I am coming from a completely non CS background . That's why it's taking more time for me..but thanks to Navin sir that my concepts are getting cleared..

  • @jasimkhan2813
    @jasimkhan2813 3 года назад

    Thanks alot for this informative video. Please make a video on list, Loc and package.

  • @anirbanc88
    @anirbanc88 2 года назад

    the practical world understanding of software world you provide as in explaining finally snippet is awesome man, too too cool man

  • @amrutashinde5971
    @amrutashinde5971 3 года назад

    YOU ARE AND YOUR TEACHING IS REALLY GREAT SIR

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

    Tysm!!

  • @erick5171
    @erick5171 2 года назад

    very clear and concise, awesome.

  • @manaspatil4316
    @manaspatil4316 3 года назад

    Also ,always write general Exception block after writing Dividebyzero,ValueError block ,etc block
    Bcoz if by mistake you write it first no matter how much block you write after it, it will always print statement in general exception block .

  • @venkateshagraharapu1393
    @venkateshagraharapu1393 2 года назад

    Very good explanation sir .thank you.

  • @rajarshimandal3235
    @rajarshimandal3235 4 года назад +1

    Just amazing 😀😀😀

  • @prabur3296
    @prabur3296 4 года назад

    Wonderful explanation for finally block!!

  • @indomusic791
    @indomusic791 3 года назад

    Excellent explanation. You are an extraordinary teacher🙏

  • @anuragr5850
    @anuragr5850 2 года назад

    Great teaching style! hats off for simplifying this concept✌

  • @rajnandani4789
    @rajnandani4789 3 года назад

    I'm very grateful
    Thank you so much sir for great explanation ,

  • @CallmeKaram
    @CallmeKaram 4 года назад

    I'm a beginner to python with little programming knowledge, I find this lecture a bit difficult although the explanation was amazing, may be I should go back and revise some terminology

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

    Your teaching is so awesome 🎉

  • @AdityaTumma_inducedfreak_
    @AdityaTumma_inducedfreak_ 4 года назад

    Now I'm recollecting this topic which was taught in class and could make sense with more brevity and logic. Had I watched this earlier, I'd have scored more in exam.

  • @surajkottayi2451
    @surajkottayi2451 3 года назад

    Python is interesting when u r taught by the right person 👍. (Navin sir)

  • @RiaziMohandesi
    @RiaziMohandesi 6 лет назад

    Thank you dear Navin. Very helpful and easy to understand.

  • @lalimarangwani6219
    @lalimarangwani6219 4 года назад

    Best video ever seen for exception handeling

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

    Wow. Nice explanation. Thank you.........

  • @anuragtiwary
    @anuragtiwary 5 лет назад +1

    Wow. A big thumbs up for this video. Made my day.
    Thank you.

  • @prashantsoroutw1753
    @prashantsoroutw1753 2 года назад

    sir your teaching style is so good.

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

    Pretty clear explanation; thanks for sharing your knowledge.

  • @isaaclee0526
    @isaaclee0526 5 лет назад

    Hi Telusko
    I have a question for python
    I don't how to do my homework
    my homework is - write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. Enter 7,2,bob,10 and 4 and match the output below.
    Invalid input
    Maximum is 10
    Minimum is 2
    This is my work
    largest = None
    smallest = None
    while True:
    num = input ('Enter a number')
    if num == 'done' : break
    try:
    number = float(num)
    except:
    print('Invalid input')
    for value in (number):
    if largest is None :
    largest = value
    elif float(value) < float(largest):
    largest = value
    print('Maximum is' ,largest)
    for value in (number):
    if smallest is None:
    smallest = value
    elif float(value) > float(smallest):
    smallest = value
    print('Minimun is' ,smallest)
    but the output is not
    Invalid input
    Maximum is 10
    Minimum is 2
    I want to know where is wrong
    Please help me

  • @sunnithreddy6031
    @sunnithreddy6031 3 года назад

    chala teluskunnam thank you. you're the best

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

    @Telusko Sir,Please explain about Python Twinkle GUI Development Topics and create project as well as

  • @thinkwith_shannu
    @thinkwith_shannu 5 лет назад

    Waah you taught it in very understandable way. Super sir

  • @yog_charya
    @yog_charya 3 года назад

    Perfect example of learning and enjoying things

  • @educationpurpose7280
    @educationpurpose7280 2 года назад

    Dear sir!
    you deserve much.
    Thanks a lot

  • @gulshankhanna5621
    @gulshankhanna5621 4 года назад

    Best explanation that i have ever seen on youtube

  • @okekolawolesunday7301
    @okekolawolesunday7301 2 года назад

    thank you for this lesson, well digested