Python exception handling ⚠️
HTML-код
- Опубликовано: 7 сен 2024
- 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...
------------------------------
# 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")
Can we use elif instead of except??
@@arafatmohammadasifbamboowa2211 I don't think so, cause you can't print what kind of exception
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
Best video I've seen on exception handling. Simple, clear, and straightforward.
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 ❤
this man in single handily gonna get me through my programming course
2:00 damn so when websites say something went wrong its just the developers being lazy lol
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
@@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.
Or you are not supposed to know, that might be bad for their PR
You are excellent exception in python programming ... You explain so perfectly...thank you😁
Always great tutorials, never stop making excellent tutorials
The official docs make a lot of sense now after this video. Thnx!
Nice! Glad my professor showed me this channel :)
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
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!!!!
That is pretty easy to understand that I find my thoughts circling in the class. Thank you bro
Didn't know the term 'exception handling', but this video helped me tremendously after I typed in my problem. Thank you!
I just started to learn Python and i wanted to thank you for the good videos . Thanks !
Very easy to understand ....thank you so much😊
As usual, Bro nailed it 💪
Great way of explaination
😄
I must say that this was an EXCEPTIOANALLY great tutorial video..!
Hell yeah!👍 You are the best teacher I've ever found
Thank you so much! This video helped to understand my homework!!
You rock...Keep up good work
thank you bro i made the mistake of not putting the input thingys inside the try statements and now i fixed it
Bro makes learning coding easy!!!
finally, a video that is easy to understand.
Your youtube channel + Programming for Everybody (Getting Started with Python) on Coursera, the best way to learn Python !
HOW LONG AGO DID YOU TAKE COURSERA'S COURSE?
ıdk what to comment but here is one to support you bc you support us big guy
Thank you bro,watching from republic of mindanao
your the goat of this generation ;)
Pre-eminent tutorial !! Thank You
this is the stuff I like on my RUclips feed!! thanks Bro
Explanations so good I fail NNN from coding euphoria
Dude YOU ARE THE BEST EVER!!!!
Quality content bro
your videos helped me alot, thanks man keep it up :)
tysm so helpful for a beginner
Great lecture 🤯
thanks man you realy are hero for real
Nice work. Thanks!
Nice explanation, thanks for the video
love your vids
May God bless you for this!
Much appreciated
I FINALLY CATCH IT THANKKKKS ...
i learned a lot, thanks
amazing😍😍
You are grateful
These videos just cannot be disliked ❤
very nice class
2:55 the most Dwight Schrute thing I've ever heard 😂
😂😂😂I was going to comment the same, identity theft is not a joke!!!😂
@@FaizanShaikh-dq1fs Beets, Bears, Battlestar Galactica
@@laurabassino6721 "Micheal Micheal " lol , btw did you complete all python course of bro code?
@@FaizanShaikh-dq1fs not yet
@Laura Bassino 🤣🤣
Thank you Broseph Broestar
amazing man this is what i was looking for.
Thank you!!
amazing !
Fun fact: an inability to divide by zero is a myth. Common convention says you can't, and that's fine for most framings, but other conventions involve division by zero to equal either zero or infinity. All three options are 'correct' in their own way, with different advantages and disadvantages to each approach.
exceptional 😀
Thanks!!🌷🌷
I like the "You can't divide by zero! Idiot!" I had just finished typing "You fucked up hard" to print under 'except Exception:'
Thx for teaching
🎉🎉🎉
Absolutely great
Nice
Thanks bro!
good
So cool
good tutor bro
bro is cooking man
Thanks,bro
niceeee😍
Thanks.... God bless you....
Good vid once again🙂
Thanks for the video bro
Bro you are awesome
Yo bro cool vid
Thanks dude
Thanks bro ❤️
Duuuude this video was awesome 👌 👏 👍 😍
Thanks bro
Bro so underrated
thank you
Thanks
good teach🍕
NICE!
something went right👌
U r legend!
Thank you!
thanks for this video 58 more videos to go
Nice Video!
print("You are a legend")
well explained
great vid!
print("Thank you Bro Code")
Great!
thank you........
love u bro
The best
thx bro
Bro code for life
tq
Good job broo :)
hi mam ela vunavu
thanks !