Python exception handling ⚠️

Ғылым және технология

Python exception handling tutorial example explained
#python #exception #exceptions
exception = events detected during execution that interrupt the flow of a program
try:
numerator = int(input("Enter a number to divide: "))
denominator = int(input("Enter a number to divide by: "))
result = numerator / denominator
except ZeroDivisionError as e:
print(e)
print("You can't divide by zero! idiot!")
except ValueError as e:
print(e)
print("Enter only numbers plz")
except Exception as e:
print(e)
print("something went wrong :(")
else:
print(result)
finally:
print("This will always execute")
------------------------------
Up In My Jam (All Of A Sudden) by - Kubbi / kubbi
Creative Commons - Attribution-ShareAlike 3.0 Unported- CC BY-SA 3.0
Free Download / Stream: bit.ly/2JnDfCE
Music promoted by Audio Library • Up In My Jam (All Of A...
------------------------------

Пікірлер: 151

  • @BroCodez
    @BroCodez3 жыл бұрын

    # exception = events detected during execution that interrupt the flow of a program try: numerator = int(input("Enter a number to divide: ")) denominator = int(input("Enter a number to divide by: ")) result = numerator / denominator except ZeroDivisionError as e: print(e) print("You can't divide by zero! idiot!") except ValueError as e: print(e) print("Enter only numbers plz") except Exception as e: print(e) print("something went wrong :(") else: print(result) finally: print("This will always execute")

  • @arafatmohammadasifbamboowa2211

    @arafatmohammadasifbamboowa2211

    2 жыл бұрын

    Can we use elif instead of except??

  • @macklykyn8967

    @macklykyn8967

    2 жыл бұрын

    @@arafatmohammadasifbamboowa2211 I don't think so, cause you can't print what kind of exception

  • @ghobashi2000

    @ghobashi2000

    Жыл бұрын

    man, it's strange to say that but at first: thank you so much, i like people like you who help us a lot for free and also with a very good content i want to ask you to read about islam if u r not a muslim and try to read quran and Allah, i won't ask for more, just try reading about these topic in the intention of knowing the truth and following it. i just asked for this because i want to say thank your in a very good way, and i hope you don't get it wrong. btw keep this brilliant content and videos and thx again. take care

  • @KarinFields
    @KarinFields7 ай бұрын

    Best video I've seen on exception handling. Simple, clear, and straightforward.

  • @Engmelli
    @Engmelli2 жыл бұрын

    2:00 damn so when websites say something went wrong its just the developers being lazy lol

  • @damansomaiah6535

    @damansomaiah6535

    6 ай бұрын

    Not really, it's practically impossible to cover every single possible error in a website, if you get the ones that are covered though it will specify

  • @2bfrank657

    @2bfrank657

    Ай бұрын

    ​@@damansomaiah6535A clear reason to not simply except all exceptions is that you prevent the original exception message from being presented to the user. "Something went wrong" is less useful to the user than whatever error message the underlying code would have given.

  • @DanielHai-ow3km

    @DanielHai-ow3km

    22 күн бұрын

    Or you are not supposed to know, that might be bad for their PR

  • @passportbro904
    @passportbro904 Жыл бұрын

    So.... you know when people say i wish i could like this video 100 times, well i liked it twice, once on my phone and once on my laptop where i was taking notes from. Bro? How you make that so easy when 50 minutes ago i was sweating this topic? Now i can move on with confidence because im a bro learner 😂 Thanks Bro ❤

  • @elliotradley4370
    @elliotradley4370 Жыл бұрын

    Always great tutorials, never stop making excellent tutorials

  • @TheWeirdTeenager2010
    @TheWeirdTeenager20103 ай бұрын

    this man in single handily gonna get me through my programming course

  • @user-mg4kw8zp4p
    @user-mg4kw8zp4p10 ай бұрын

    Thank you bro...because of you i have come this far . Very soon I will cover this playlist. Never stop making videos. I will always be grateful to you

  • @shriniketkulkarni8169
    @shriniketkulkarni81698 ай бұрын

    You are excellent exception in python programming ... You explain so perfectly...thank you😁

  • @htetmyetthar5650
    @htetmyetthar5650Ай бұрын

    That is pretty easy to understand that I find my thoughts circling in the class. Thank you bro

  • @GabeSkorski
    @GabeSkorski5 ай бұрын

    Nice! Glad my professor showed me this channel :)

  • @johnstonbrandon
    @johnstonbrandon3 ай бұрын

    Best code teacher I've ever seen!!! I know it's prolly easy for you, but I learned more from 3 of your videos than I learned from a week of Chat GPT. Thanks my dude!!! Will like and sub!!!!

  • @user-os5ky3zh8r
    @user-os5ky3zh8r2 ай бұрын

    I just started to learn Python and i wanted to thank you for the good videos . Thanks !

  • @Greenbay-bn3yk
    @Greenbay-bn3ykАй бұрын

    Hell yeah!👍 You are the best teacher I've ever found

  • @piotrkopcewicz5227
    @piotrkopcewicz52272 жыл бұрын

    Pre-eminent tutorial !! Thank You

  • @swetankraut6065
    @swetankraut60655 ай бұрын

    I must say that this was an EXCEPTIOANALLY great tutorial video..!

  • @user-fh1uz3gn3r
    @user-fh1uz3gn3r Жыл бұрын

    Thank you so much! This video helped to understand my homework!!

  • @LauraAnna-vn7st
    @LauraAnna-vn7st3 күн бұрын

    Very easy to understand ....thank you so much😊

  • @AD-cc7bj
    @AD-cc7bj3 ай бұрын

    Didn't know the term 'exception handling', but this video helped me tremendously after I typed in my problem. Thank you!

  • @theamithsingh
    @theamithsingh Жыл бұрын

    As usual, Bro nailed it 💪

  • @X_habesha
    @X_habesha5 ай бұрын

    your videos helped me alot, thanks man keep it up :)

  • @misran449
    @misran4498 ай бұрын

    this is the stuff I like on my KZread feed!! thanks Bro

  • @ahmedalihenawy7054
    @ahmedalihenawy70542 ай бұрын

    Great way of explaination 😄

  • @Qustode
    @Qustode Жыл бұрын

    Nice explanation, thanks for the video

  • @tylerhopkins2868
    @tylerhopkins28682 жыл бұрын

    Nice work. Thanks!

  • @Gladysnjoki
    @Gladysnjoki Жыл бұрын

    You rock...Keep up good work

  • @leinadpq9527
    @leinadpq9527 Жыл бұрын

    finally, a video that is easy to understand.

  • @bharathpavurala7817
    @bharathpavurala7817 Жыл бұрын

    Great lecture 🤯

  • @somthing7286
    @somthing72869 ай бұрын

    thank you bro i made the mistake of not putting the input thingys inside the try statements and now i fixed it

  • @nasiriqbal5475
    @nasiriqbal54758 ай бұрын

    Bro makes learning coding easy!!!

  • @matejgrasic4285
    @matejgrasic4285 Жыл бұрын

    Question from newbie: and how to do this on large file? i.e. do you create separate .py file to handle errors or we need to do it this way? Thank you in advance

  • @heal294
    @heal2943 ай бұрын

    love your vids

  • @alphad9474
    @alphad94742 жыл бұрын

    amazing !

  • @AndreiAcojido
    @AndreiAcojido4 ай бұрын

    Thank you bro,watching from republic of mindanao

  • @senaustun4380
    @senaustun43804 ай бұрын

    ıdk what to comment but here is one to support you bc you support us big guy

  • @thePRECIOUS_1
    @thePRECIOUS_15 ай бұрын

    amazing man this is what i was looking for.

  • @thorcoder1
    @thorcoder13 жыл бұрын

    You are grateful

  • @divinityinversace
    @divinityinversace Жыл бұрын

    tysm so helpful for a beginner

  • @user-me7tt8uz9b
    @user-me7tt8uz9b8 ай бұрын

    Absolutely great

  • @mariamsahak2130
    @mariamsahak21306 ай бұрын

    May God bless you for this!

  • @user-yr8qs7fm7o
    @user-yr8qs7fm7o Жыл бұрын

    Dude YOU ARE THE BEST EVER!!!!

  • @wenbinli9807
    @wenbinli98075 ай бұрын

    very nice class

  • @One_piece1089
    @One_piece10896 ай бұрын

    amazing😍😍

  • @sophiawang2400
    @sophiawang2400 Жыл бұрын

    Thx for teaching 🎉🎉🎉

  • @Dreamon-np5tb
    @Dreamon-np5tb2 ай бұрын

    Much appreciated

  • @christianihechi
    @christianihechi2 ай бұрын

    Thank you!!

  • @PeakPotential766
    @PeakPotential7662 ай бұрын

    thanks man you realy are hero for real

  • @kapibara2440
    @kapibara24408 ай бұрын

    These videos just cannot be disliked ❤

  • @anuvhabbasu2599
    @anuvhabbasu2599Ай бұрын

    Quality content bro

  • @dineshgautam7027
    @dineshgautam70272 жыл бұрын

    Thanks.... God bless you....

  • @sadeghkhosravi
    @sadeghkhosravi11 ай бұрын

    Thanks!!🌷🌷

  • @faresmohamed9447
    @faresmohamed944718 күн бұрын

    i learned a lot, thanks

  • @vincentb1771
    @vincentb17717 ай бұрын

    Explanations so good I fail NNN from coding euphoria

  • @user-ps2fq4vu2k
    @user-ps2fq4vu2k2 жыл бұрын

    Duuuude this video was awesome 👌 👏 👍 😍

  • @spartanranger
    @spartanranger2 жыл бұрын

    Thanks for the video bro

  • @kumarmanglam815
    @kumarmanglam8158 ай бұрын

    exceptional 😀

  • @kemann3815
    @kemann38152 жыл бұрын

    Thank you!

  • @GTV_367
    @GTV_36710 ай бұрын

    Good vid once again🙂

  • @user-by7zz7gm3c
    @user-by7zz7gm3c2 ай бұрын

    Thanks bro!

  • @arulsingh5741
    @arulsingh57413 жыл бұрын

    Nice

  • @gurudathg1328
    @gurudathg1328 Жыл бұрын

    Is finally block is useful? We can also add a statement in last also

  • @starplatinum6181
    @starplatinum61812 жыл бұрын

    Nice Video!

  • @manuela7477
    @manuela7477 Жыл бұрын

    Great!

  • @yahyaazad2990
    @yahyaazad299010 ай бұрын

    niceeee😍

  • @Mutable7
    @Mutable72 жыл бұрын

    Thanks bro ❤️

  • @johnwarner9102
    @johnwarner9102 Жыл бұрын

    great vid!

  • @mdyusufulhaque9953
    @mdyusufulhaque9953 Жыл бұрын

    well explained

  • @dagim6625
    @dagim66255 ай бұрын

    Thanks,bro

  • @gamePlays9699
    @gamePlays9699 Жыл бұрын

    NICE!

  • @hungnguyentien1223
    @hungnguyentien1223Ай бұрын

    guys Im currently following this playlist to learn python, Im just wondering if this is enough for me to start solving leetcode problems or I need to learn more method or syntaxes or something else?

  • @lw9954
    @lw9954 Жыл бұрын

    Thank you Broseph Broestar

  • @augustinegeorge633
    @augustinegeorge633 Жыл бұрын

    Bro you are awesome

  • @scottjeffery4583
    @scottjeffery45832 ай бұрын

    Thanks

  • @user-vr2si8on9f
    @user-vr2si8on9f10 ай бұрын

    good

  • @NiLizee812
    @NiLizee8124 ай бұрын

    good tutor bro

  • @gamePlays9699
    @gamePlays9699 Жыл бұрын

    U r legend!

  • @kasmeneyes2227
    @kasmeneyes2227 Жыл бұрын

    Your youtube channel + Programming for Everybody (Getting Started with Python) on Coursera, the best way to learn Python !

  • @TheJossephc

    @TheJossephc

    10 ай бұрын

    HOW LONG AGO DID YOU TAKE COURSERA'S COURSE?

  • @iknowyoureawesome693
    @iknowyoureawesome69310 күн бұрын

    Thanks dude

  • @sajinvithayathil2158
    @sajinvithayathil21588 ай бұрын

    thank you

  • @shawkir35
    @shawkir356 ай бұрын

    Thanks bro

  • @michalski9141
    @michalski91412 жыл бұрын

    How would I make it say that {whatever you typed in} is not a number

  • @DanielHai-ow3km
    @DanielHai-ow3km22 күн бұрын

    Yo bro cool vid

  • @Dreamon-np5tb
    @Dreamon-np5tb2 ай бұрын

    Thanks Bro

  • @user-xk7de1jw8g
    @user-xk7de1jw8g11 ай бұрын

    Do game developer always put their entire codes inside a try-except-finally block?

  • @saragh7006
    @saragh70062 жыл бұрын

    I FINALLY CATCH IT THANKKKKS ...

  • @user-pf7rr7bv5n
    @user-pf7rr7bv5n3 ай бұрын

    thanks

  • @afskils107
    @afskils107 Жыл бұрын

    good teach🍕

  • @altanbengiler8315
    @altanbengiler8315 Жыл бұрын

    Good job broo :)

  • @HussainAli-sb1dv
    @HussainAli-sb1dv8 ай бұрын

    love u bro

  • @airlanggak5391
    @airlanggak53912 жыл бұрын

    thanks !

  • @maddulavk332
    @maddulavk3324 ай бұрын

    tq

  • @uuhju7004
    @uuhju70043 жыл бұрын

    ty

  • @techlace1195
    @techlace1195 Жыл бұрын

    thx bro

  • @beingzero7541
    @beingzero75412 жыл бұрын

    Wow!

  • @anurashik7584
    @anurashik75849 ай бұрын

    thank you........

  • @user-dv7mr6mu7w
    @user-dv7mr6mu7w5 ай бұрын

    The best

  • @laurabassino6721
    @laurabassino67213 жыл бұрын

    2:55 the most Dwight Schrute thing I've ever heard 😂

  • @FaizanShaikh-dq1fs

    @FaizanShaikh-dq1fs

    2 жыл бұрын

    😂😂😂I was going to comment the same, identity theft is not a joke!!!😂

  • @laurabassino6721

    @laurabassino6721

    2 жыл бұрын

    @@FaizanShaikh-dq1fs Beets, Bears, Battlestar Galactica

  • @FaizanShaikh-dq1fs

    @FaizanShaikh-dq1fs

    2 жыл бұрын

    @@laurabassino6721 "Micheal Micheal " lol , btw did you complete all python course of bro code?

  • @laurabassino6721

    @laurabassino6721

    2 жыл бұрын

    @@FaizanShaikh-dq1fs not yet

  • @gurudathg1328

    @gurudathg1328

    Жыл бұрын

    @Laura Bassino 🤣🤣

  • @Tk_the_0ne
    @Tk_the_0ne6 ай бұрын

    bro is cooking man

  • @siciliandragon8654
    @siciliandragon8654 Жыл бұрын

    I like the "You can't divide by zero! Idiot!" I had just finished typing "You fucked up hard" to print under 'except Exception:'

  • @ayush118
    @ayush118 Жыл бұрын

    what is the point of having an "else" statement? because if an error occurred then nothing would be outputted anyways so whats the point

  • @riceball7238
    @riceball72385 ай бұрын

    thanks for this video 58 more videos to go

Келесі