I really struggled to understand the try and except before watching this. You explained it quickly and clearly and now I feel very confident with it. Thanks!
Thanks much for these videos! They are super helpful to me as a novice who is hoping to teach myself to code over the next year. One question, when should try&except be used instead of if statements?
You should use try & except for errors that would stop the code from running. If statements you can use it like a try&except to filter input, it wont catch error codes
Hii Tim after running a code I'm getting an error like this:- code: myList = [97,98,99,100] myList[1:1] = -40 print(myList) TypeError: can only assign an iterable
In some situations, if-else would handle the exception as well (by checking data type, for example), but in other situations, some errors and exceptions can't be caught by an if statement.
I really struggled to understand the try and except before watching this. You explained it quickly and clearly and now I feel very confident with it. Thanks!
Thanks much for these videos! They are super helpful to me as a novice who is hoping to teach myself to code over the next year. One question, when should try&except be used instead of if statements?
You should use try & except for errors that would stop the code from running.
If statements you can use it like a try&except to filter input, it wont catch error codes
@@mordekai23 yo great answer
real practical examples help to understand the purpose of the function and you did it....🙂 thanks
When is your next video? :D Keep it up!
Great work broo. I was confused about this, you helped me a lot. You described it very clearly. THANKS. SUBSCRIBED
Nice and clear. Great video
Thanks Tim, this tutorial helped me a lot.
Perfect and concise!
Ur amazing! Thanks so much for these amazing tutorials.
Hey man, great video. Thanks for posting it.
Zoe Mushrooms
Wrong post 😂 Sorry!
Who here noticed that he changed the position of Minecraft
Best tuts on yt!
Nice video
Watched at 2x
Meet you in next one
You play Minecraft, Nice
Morty wsp
Nice video
Nice I got the 200th Like, So satisfying
thank you tim, you clear my doubts
great tutorial
Thank you very much for your video.
very good
great video
So under that except block can you do a print function for a user input to try again?
If the 'try' function works, do you leave it in the program or do you replace it with an 'if' or something else...?
Hii Tim after running a code I'm getting an error like this:-
code:
myList = [97,98,99,100]
myList[1:1] = -40
print(myList)
TypeError: can only assign an iterable
Try this:
myList = [97,98,99,100]
myList[1] = -40
print(myList)
u savedm y life
so except and try go together
How is this any different than if-else?
"do or do not, there is no try"
-yoda
so what if you removed except?
can someone tell me the difference between this and the 'if' and 'else' statement?
In some situations, if-else would handle the exception as well (by checking data type, for example), but in other situations, some errors and exceptions can't be caught by an if statement.
its just "If and Else" why we have to use this??
Still crashes bc it uses an excel file, I want to avoid crash when run and the file is open :(
this does not work...
Hat mir nicht geholfen. Hab lieber David gefragt.