Advanced Python- Exception Handling Detailed Explanation In Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 68

  • @pushpitkumar99
    @pushpitkumar99 3 ปีที่แล้ว +30

    Errors can be corrected during compilation of source code or even at runtime. It can syntax error or semantic error. Exceptions are caused during run time when the interpreter gets some unexpected data. They are handled using try and except technique. Hey Krish, just wanted to say Thanks a lot for uploading these amazing videos. I've recently started watching your playlists and I really feel confident and motivated about my Data Science journey.

    • @meetkorat05
      @meetkorat05 3 หลายเดือนก่อน

      hello brother , can i communicate with you ?

    • @pushpitkumar99
      @pushpitkumar99 3 หลายเดือนก่อน

      @@meetkorat05 Sure

  • @chaitanyamallepudi3531
    @chaitanyamallepudi3531 3 ปีที่แล้ว +24

    Errors could be identified & corrected during compile time; whereas Exceptions can be only identified during run time and can be handled with try catch

  • @divyanshusharma4459
    @divyanshusharma4459 3 ปีที่แล้ว +3

    error = We take error as the program syntax is gonna wrong somewhere or something.
    Exception = It basically means that the thing is out of the league for the program
    example:- we make a function to find the number is even or odd and when the user gave input it gave the string which is out of the league for the defined function. It through an exception

  • @jagadeeshabburi570
    @jagadeeshabburi570 3 ปีที่แล้ว +3

    Amazing, I always use generic exceprion. Came to know how to use diff types of exceptions. ❤

  • @nandhakishore8950
    @nandhakishore8950 3 ปีที่แล้ว +28

    Errors can't be handled whereas Exception can be handled during run time!

    • @NoName-yk2do
      @NoName-yk2do 3 ปีที่แล้ว +2

      instagram.com/reel/CJqWADig7-p/?igshid=myy8870fdw6j

  • @KAAO-rb9lh
    @KAAO-rb9lh 5 วันที่ผ่านมา

    errors is raised at compile time and corrected also done at time.but exceptions is raised in only in runtime environments handled with try except block

  • @navalsehgal1015
    @navalsehgal1015 3 หลายเดือนก่อน

    Compile time is concerned with preparing the code for execution, while runtime is concerned with the actual execution of the program.

  • @VagheeshMK
    @VagheeshMK ปีที่แล้ว

    Errors can be broadly classified into 2, Syntax Errors and Non-Syntax Errors. Non-Syntax Errors are called Exceptions

  • @ramshankarkumar4222
    @ramshankarkumar4222 3 ปีที่แล้ว +1

    Error mainly happens during run time .. it belongs to uncheck type ..... but exception can happen during runtime as well as compile time also and ofcourse exception can be handled but not the error.

  • @spicytuna08
    @spicytuna08 3 ปีที่แล้ว +1

    great stuff Krish. Learning something important everyday from you. Can't thank you enough.

  • @rajnigoyal6653
    @rajnigoyal6653 3 ปีที่แล้ว +2

    Error stops programme once it happens whereas exception handling is for defining various scenarios if they happen user understand the mistake well.

  • @Chittema
    @Chittema 3 ปีที่แล้ว +4

    when an error occurs, it stops the execution of the program abruptly, where as exceptions can be handled and helps us to exit the program gracefully.

  • @dataanalyticsfun9883
    @dataanalyticsfun9883 3 ปีที่แล้ว +3

    Thanks lots for your amazing tutorial .
    Sir I am requesting you please make videos regarding data structure and algorithm with real life examples.

  • @wasifsheikh260
    @wasifsheikh260 3 ปีที่แล้ว +9

    Hi Krish! Thanks a lot for creating awesome Videos, they really helped me to grab my first data science job. Please create videos on Adv. optimisation like genetic optimisation And simulation

    • @NoName-yk2do
      @NoName-yk2do 3 ปีที่แล้ว

      instagram.com/reel/CJqWADig7-p/?igshid=myy8870fdw6j

  • @RohitShinde2000
    @RohitShinde2000 ปีที่แล้ว +1

    Error is that you will get at compile time and exception is basically occur at runtime

  • @adityaf17
    @adityaf17 ปีที่แล้ว

    Great stuff by @krish naik
    The example provided in the last minute was pretty useful

  • @shruthiabirami232
    @shruthiabirami232 3 ปีที่แล้ว +3

    The examples are so good ❤

    • @NoName-yk2do
      @NoName-yk2do 3 ปีที่แล้ว

      instagram.com/reel/CJqWADig7-p/?igshid=myy8870fdw6j

  • @mechanicalengineeringclass563
    @mechanicalengineeringclass563 2 ปีที่แล้ว

    Perfectly explain

  • @abhinavm9685
    @abhinavm9685 3 ปีที่แล้ว +4

    Respected sir,
    I am new to the whole concept of machine learning and would like to learn it to an extent that I will be able to do some real world project in my collage using ML.. I just wanted to know if this playlist will serve my purpose sir. And by the way, your teaching is excellent...its just like how a friend teaches stuff...Thankyou!

  • @vengalrao5772
    @vengalrao5772 2 ปีที่แล้ว

    Priceless

  • @pragyamsoni2981
    @pragyamsoni2981 3 ปีที่แล้ว +1

    Sir can you plz make videos on exercises related to python for beginners , intermediates and advanced

  • @fariqjamil5484
    @fariqjamil5484 ปีที่แล้ว

    Error is something wrongdoing in your code detected by compiler whereas exception is somehow a warning made by developer at error prone area.

  • @louerleseigneur4532
    @louerleseigneur4532 3 ปีที่แล้ว

    Thanks Krish

  • @joynandi9906
    @joynandi9906 3 ปีที่แล้ว

    error can be due to syntax issue however exception are always syntactically correct.

  • @keenzeen
    @keenzeen 2 ปีที่แล้ว

    How can we access the variable outside the try block?

  • @hrithikrana840
    @hrithikrana840 3 ปีที่แล้ว

    Great Explanation !

  • @itsvickysen
    @itsvickysen 3 ปีที่แล้ว

    Thank u sir, u made it clear !

  • @sumitbhagat7580
    @sumitbhagat7580 3 ปีที่แล้ว

    errors are occurred due to wrongly coding, or wrongly entered input & exception is a diversion of program from throwing an error & smoothly showing an error without stopping the program.

  • @talentzunlimited1398
    @talentzunlimited1398 ปีที่แล้ว

    Awesome !

  • @venkatas3953
    @venkatas3953 3 ปีที่แล้ว

    Exceptions are violation to defined rules.
    Errors are exception that are not handled and occurs during runtime.

  • @abuazfaar3662
    @abuazfaar3662 3 ปีที่แล้ว +3

    Hi sir, how can I have a conversation with you. I have some issues regarding academic and personal. Please if you have time, give me some indications.

    • @rajmalkar2687
      @rajmalkar2687 3 ปีที่แล้ว

      Join the telegram grp link of which is in the description

  • @user_ut-g6t
    @user_ut-g6t 27 วันที่ผ่านมา

    Mein input lene ja raha hu to apne aap hi markdown ho ja raha hain jupyter Notebook mein esa kyu ho raha hain?

  • @mdumar6479
    @mdumar6479 ปีที่แล้ว

    What it's mean if writeen
    excep exception as e:
    raise e

  • @rajath1964
    @rajath1964 3 ปีที่แล้ว +1

    isn't there a playlist for this?

    • @krishnaik06
      @krishnaik06  3 ปีที่แล้ว +1

      Check the description

  • @basavarajag1901
    @basavarajag1901 ปีที่แล้ว

    error - systax error occured on while compile our code , exception is errors while execution

  • @rishimondal3010
    @rishimondal3010 10 หลายเดือนก่อน

    Ei trace call back error kya hai?

  • @mirabirhossain1842
    @mirabirhossain1842 3 ปีที่แล้ว +1

    Can anyone give me the answer of this question? When I write
    except Exception:
    print(Exception)
    output is ''
    but when I write
    except Exception as ex:
    print(ex)
    output is 'name 'b' is not defined'
    why "as ex" is changing the output?

    • @rishikambhampati2862
      @rishikambhampati2862 3 ปีที่แล้ว +2

      Because Exception itself is a class, in the first case '' is getting printed. In the second case you are capturing whatever exception has occurred in the try block using 'except Exception as ex', therefore this ex variable has the specific exception that has occurred in the try block

    • @mirabirhossain1842
      @mirabirhossain1842 3 ปีที่แล้ว +1

      @@rishikambhampati2862 Thank you for the explanation

  • @suhasinihasini6141
    @suhasinihasini6141 2 ปีที่แล้ว

    Can the Exception class handle multiple exceptions at a time?

    • @lepidoptera9337
      @lepidoptera9337 ปีที่แล้ว

      They can be nested, however, Python doesn't have real parallelism, so it's always one at a time anyway.

  • @ADK00787
    @ADK00787 3 ปีที่แล้ว +1

    Pls add the videos on series of genetic algorithms after adv python series. Thank You Sir

  • @varanasijagadeesh5619
    @varanasijagadeesh5619 3 ปีที่แล้ว

    Sir, why we can't use else block for closing the database

    • @krishnaik06
      @krishnaik06  3 ปีที่แล้ว +2

      What excpetion may come how will you know when performing complex operations

    • @varanasijagadeesh5619
      @varanasijagadeesh5619 3 ปีที่แล้ว

      Sir, can we perform the remaining operations by skipping that particular exception

  • @sreeramsaravanan8132
    @sreeramsaravanan8132 3 ปีที่แล้ว

    How to print error line no in exception handling

  • @MuhammadShahzad-dx5je
    @MuhammadShahzad-dx5je 3 ปีที่แล้ว

    #awesome

  • @killersawant
    @killersawant 3 ปีที่แล้ว

    hey krish !
    I am a 2020 engineering graduate living in Mumbai. You made an entire video about how to follow your structured playlist to become data scientist .Now suppose I follow it and only do machine learning and skip the deep learning part can I still land a job in Mumbai ? if yes , how much would I make as a fresher?
    can anyone else reply as well ?

  • @varanasijagadeesh5619
    @varanasijagadeesh5619 3 ปีที่แล้ว

    Sir, can we perform the remaining operations by skipping a particular exception error

    • @devotional8067
      @devotional8067 3 ปีที่แล้ว +1

      If there is no dependency, then you can skip and go continue from next

  • @PiyushNandan7
    @PiyushNandan7 3 ปีที่แล้ว

    If end user give wrong input called error

  • @baskarkevin1170
    @baskarkevin1170 ปีที่แล้ว

    Done

  • @prabhakaryadav3791
    @prabhakaryadav3791 3 ปีที่แล้ว

    👌

  • @shoaib2307
    @shoaib2307 3 ปีที่แล้ว

    20:00 so basically whatever happens
    The database will always be closed

    • @NoName-yk2do
      @NoName-yk2do 3 ปีที่แล้ว

      instagram.com/reel/CJqWADig7-p/?igshid=myy8870fdw6j

  • @shariqueaslam8474
    @shariqueaslam8474 3 ปีที่แล้ว +1

    U should dictate in hindi 🙏🙏

  • @indirajithkv7793
    @indirajithkv7793 2 ปีที่แล้ว

    ❤✨

  • @lepidoptera9337
    @lepidoptera9337 ปีที่แล้ว

    Exception handling is not an advanced concept. It's also pretty useless in most cases. What an exception usually tells you is that you made a software design mistake. For bugs that you can anticipate it can be used as a catch-all debugging tool. Good design never even gets into that kind of mess. The main scenarios where you absolutely need exceptions are if have to work with incomplete APIs that do not let you guarantee correctness by design (i.e. other people's bad software design) and then in situations that change in real-time in which the code can never anticipate what will happen.

  • @ashwinkumarbhagwat900
    @ashwinkumarbhagwat900 3 ปีที่แล้ว +2

    Sir,
    I sent message on telegram.
    Please reply

  • @arnoldwolfstein
    @arnoldwolfstein 3 ปีที่แล้ว

    This is not even basic python. where is the advanced? lol