Python exception handling ⚠️

  Рет қаралды 53,122

Bro Code

Bro Code

3 жыл бұрын

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...
------------------------------

Пікірлер: 145
@BroCodez
@BroCodez 3 жыл бұрын
# 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 Жыл бұрын
@@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
@Engmelli
@Engmelli 2 жыл бұрын
2:00 damn so when websites say something went wrong its just the developers being lazy lol
@damansomaiah6535
@damansomaiah6535 5 ай бұрын
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 20 күн бұрын
​@@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.
@KarinFields
@KarinFields 6 ай бұрын
Best video I've seen on exception handling. Simple, clear, and straightforward.
@elliotradley4370
@elliotradley4370 Жыл бұрын
Always great tutorials, never stop making excellent tutorials
@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 ❤
@user-mg4kw8zp4p
@user-mg4kw8zp4p 9 ай бұрын
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
@shriniketkulkarni8169 7 ай бұрын
You are excellent exception in python programming ... You explain so perfectly...thank you😁
@TheWeirdTeenager2010
@TheWeirdTeenager2010 2 ай бұрын
this man in single handily gonna get me through my programming course
@johnstonbrandon
@johnstonbrandon 2 ай бұрын
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!!!!
@Greenbay-bn3yk
@Greenbay-bn3yk 29 күн бұрын
Hell yeah!👍 You are the best teacher I've ever found
@user-os5ky3zh8r
@user-os5ky3zh8r Ай бұрын
I just started to learn Python and i wanted to thank you for the good videos . Thanks !
@htetmyetthar5650
@htetmyetthar5650 3 күн бұрын
That is pretty easy to understand that I find my thoughts circling in the class. Thank you bro
@piotrkopcewicz5227
@piotrkopcewicz5227 Жыл бұрын
Pre-eminent tutorial !! Thank You
@theamithsingh
@theamithsingh Жыл бұрын
As usual, Bro nailed it 💪
@swetankraut6065
@swetankraut6065 4 ай бұрын
I must say that this was an EXCEPTIOANALLY great tutorial video..!
@AD-cc7bj
@AD-cc7bj 3 ай бұрын
Didn't know the term 'exception handling', but this video helped me tremendously after I typed in my problem. Thank you!
@user-fh1uz3gn3r
@user-fh1uz3gn3r Жыл бұрын
Thank you so much! This video helped to understand my homework!!
@GabeSkorski
@GabeSkorski 4 ай бұрын
Nice! Glad my professor showed me this channel :)
@misran449
@misran449 7 ай бұрын
this is the stuff I like on my KZfaq feed!! thanks Bro
@Xhabesha.
@Xhabesha. 4 ай бұрын
your videos helped me alot, thanks man keep it up :)
@ahmedalihenawy7054
@ahmedalihenawy7054 Ай бұрын
Great way of explaination 😄
@tylerhopkins2868
@tylerhopkins2868 2 жыл бұрын
Nice work. Thanks!
@senaustun4380
@senaustun4380 3 ай бұрын
ıdk what to comment but here is one to support you bc you support us big guy
@Gladysnjoki
@Gladysnjoki Жыл бұрын
You rock...Keep up good work
@Qustode
@Qustode 11 ай бұрын
Nice explanation, thanks for the video
@nasiriqbal5475
@nasiriqbal5475 7 ай бұрын
Bro makes learning coding easy!!!
@bharathpavurala7817
@bharathpavurala7817 Жыл бұрын
Great lecture 🤯
@leinadpq9527
@leinadpq9527 Жыл бұрын
finally, a video that is easy to understand.
@thePRECIOUS_1
@thePRECIOUS_1 4 ай бұрын
amazing man this is what i was looking for.
@somthing7286
@somthing7286 8 ай бұрын
thank you bro i made the mistake of not putting the input thingys inside the try statements and now i fixed it
@AndreiAcojido
@AndreiAcojido 3 ай бұрын
Thank you bro,watching from republic of mindanao
@kapibara2440
@kapibara2440 7 ай бұрын
These videos just cannot be disliked ❤
@mariamsahak2130
@mariamsahak2130 5 ай бұрын
May God bless you for this!
@heal294
@heal294 2 ай бұрын
love your vids
@user-ps2fq4vu2k
@user-ps2fq4vu2k 2 жыл бұрын
Duuuude this video was awesome 👌 👏 👍 😍
@divinityinversace
@divinityinversace Жыл бұрын
tysm so helpful for a beginner
@anuvhabbasu2599
@anuvhabbasu2599 11 күн бұрын
Quality content bro
@wenbinli9807
@wenbinli9807 4 ай бұрын
very nice class
@user-yr8qs7fm7o
@user-yr8qs7fm7o Жыл бұрын
Dude YOU ARE THE BEST EVER!!!!
@sophiawang2400
@sophiawang2400 Жыл бұрын
Thx for teaching 🎉🎉🎉
@thorcoder1
@thorcoder1 3 жыл бұрын
You are grateful
@One_piece1089
@One_piece1089 5 ай бұрын
amazing😍😍
@alphad9474
@alphad9474 2 жыл бұрын
amazing !
@PeakPotential766
@PeakPotential766 Ай бұрын
thanks man you realy are hero for real
@user-me7tt8uz9b
@user-me7tt8uz9b 7 ай бұрын
Absolutely great
@spartanranger
@spartanranger 2 жыл бұрын
Thanks for the video bro
@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
@vincentb1771
@vincentb1771 6 ай бұрын
Explanations so good I fail NNN from coding euphoria
@christianihechi
@christianihechi Ай бұрын
Thank you!!
@Dreamon-np5tb
@Dreamon-np5tb Ай бұрын
Much appreciated
@dineshgautam7027
@dineshgautam7027 2 жыл бұрын
Thanks.... God bless you....
@GTV_367
@GTV_367 9 ай бұрын
Good vid once again🙂
@kasmeneyes2227
@kasmeneyes2227 Жыл бұрын
Your youtube channel + Programming for Everybody (Getting Started with Python) on Coursera, the best way to learn Python !
@TheJossephc
@TheJossephc 9 ай бұрын
HOW LONG AGO DID YOU TAKE COURSERA'S COURSE?
@sadeghkhosravi
@sadeghkhosravi 10 ай бұрын
Thanks!!🌷🌷
@kumarmanglam815
@kumarmanglam815 7 ай бұрын
exceptional 😀
@starplatinum6181
@starplatinum6181 2 жыл бұрын
Nice Video!
@kemann3815
@kemann3815 2 жыл бұрын
Thank you!
@user-by7zz7gm3c
@user-by7zz7gm3c Ай бұрын
Thanks bro!
@All_inOne3000
@All_inOne3000 2 жыл бұрын
Thanks bro ❤️
@NiLizee812
@NiLizee812 3 ай бұрын
good tutor bro
@lw9954
@lw9954 Жыл бұрын
Thank you Broseph Broestar
@mdyusufulhaque9953
@mdyusufulhaque9953 Жыл бұрын
well explained
@johnwarner9102
@johnwarner9102 Жыл бұрын
great vid!
@dagim6625
@dagim6625 4 ай бұрын
Thanks,bro
@arulsingh5741
@arulsingh5741 3 жыл бұрын
Nice
@augustinegeorge633
@augustinegeorge633 Жыл бұрын
Bro you are awesome
@saragh7006
@saragh7006 Жыл бұрын
I FINALLY CATCH IT THANKKKKS ...
@manuela7477
@manuela7477 Жыл бұрын
Great!
@yahyaazad2990
@yahyaazad2990 9 ай бұрын
niceeee😍
@shawkir35
@shawkir35 5 ай бұрын
Thanks bro
@learningdev8960
@learningdev8960 Жыл бұрын
NICE!
@scottjeffery4583
@scottjeffery4583 Ай бұрын
Thanks
@gurudathg1328
@gurudathg1328 Жыл бұрын
Is finally block is useful? We can also add a statement in last also
@user-vr2si8on9f
@user-vr2si8on9f 10 ай бұрын
good
@Dreamon-np5tb
@Dreamon-np5tb Ай бұрын
Thanks Bro
@altanbengiler8315
@altanbengiler8315 Жыл бұрын
Good job broo :)
@sajinvithayathil2158
@sajinvithayathil2158 7 ай бұрын
thank you
@afskils107
@afskils107 11 ай бұрын
good teach🍕
@learningdev8960
@learningdev8960 Жыл бұрын
U r legend!
@laopichthyrith2490
@laopichthyrith2490 Жыл бұрын
Bro so underrated
@Tk_the_0ne
@Tk_the_0ne 5 ай бұрын
bro is cooking man
@user-pf7rr7bv5n
@user-pf7rr7bv5n 2 ай бұрын
thanks
@anurashik7584
@anurashik7584 8 ай бұрын
thank you........
@maddulavk332
@maddulavk332 3 ай бұрын
tq
@HussainAli-sb1dv
@HussainAli-sb1dv 7 ай бұрын
love u bro
@airlanggak5391
@airlanggak5391 2 жыл бұрын
thanks !
@techlace1195
@techlace1195 Жыл бұрын
thx bro
@uuhju7004
@uuhju7004 2 жыл бұрын
ty
@BroMalli
@BroMalli Жыл бұрын
grate brocode
@AftaabMulla-ir1kh
@AftaabMulla-ir1kh 5 ай бұрын
print("You are a legend")
@user-xk7de1jw8g
@user-xk7de1jw8g 10 ай бұрын
Do game developer always put their entire codes inside a try-except-finally block?
@beingzero7541
@beingzero7541 2 жыл бұрын
Wow!
@user-dv7mr6mu7w
@user-dv7mr6mu7w 4 ай бұрын
The best
@tonnyjarvis6770
@tonnyjarvis6770 Жыл бұрын
thanks gain
@xeurek4
@xeurek4 4 ай бұрын
Bro code for life
@riceball7238
@riceball7238 4 ай бұрын
thanks for this video 58 more videos to go
@74yeager
@74yeager 2 жыл бұрын
something went right👌
@hakanerenaykac1742
@hakanerenaykac1742 11 ай бұрын
print("Thank you Bro Code")
@michalski9141
@michalski9141 2 жыл бұрын
How would I make it say that {whatever you typed in} is not a number
@hungnguyentien1223
@hungnguyentien1223 19 күн бұрын
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?
Python Object Oriented Programming in 10 minutes 🐍
10:04
Bro Code
Рет қаралды 341 М.
Advanced Exception Handling in Python
12:06
NeuralNine
Рет қаралды 53 М.
ПООСТЕРЕГИСЬ🙊🙊🙊
00:39
Chapitosiki
Рет қаралды 37 МЛН
Шокирующая Речь Выпускника 😳📽️@CarrolltonTexas
00:43
Глеб Рандалайнен
Рет қаралды 11 МЛН
Чай будешь? #чайбудешь
00:14
ПАРОДИИ НА ИЗВЕСТНЫЕ ТРЕКИ
Рет қаралды 2,2 МЛН
Would you like a delicious big mooncake? #shorts#Mooncake #China #Chinesefood
00:30
Python multithreading 🧵
13:34
Bro Code
Рет қаралды 61 М.
Python Tutorial: Using Try/Except Blocks for Error Handling
10:34
Corey Schafer
Рет қаралды 681 М.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 306 М.
Python *ARGS & **KWARGS are awesome! 📦
14:54
Bro Code
Рет қаралды 68 М.
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 384 М.
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 50 М.
Жёсткий тест чехла Spigen Classic C1
0:56
Romancev768
Рет қаралды 127 М.
ПРОБЛЕМА МЕХАНИЧЕСКИХ КЛАВИАТУР!🤬
0:59
Корнеич
Рет қаралды 3,7 МЛН
Не обзор DJI Osmo Pocket 3 Creator Combo
1:00
superfirsthero
Рет қаралды 1,3 МЛН
Индуктивность и дроссель.
1:00
Hi Dev! – Электроника
Рет қаралды 1,6 МЛН
С Какой Высоты Разобьётся NOKIA3310 ?!😳
0:43
Теперь это его телефон
0:21
Хорошие Новости
Рет қаралды 2 МЛН