Exceptions in Python || Python Tutorial || Learn Python Programming

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ส.ค. 2024
  • 𝙎𝙩𝙖𝙮 𝙞𝙣 𝙩𝙝𝙚 𝙡𝙤𝙤𝙥 𝙄𝙉𝙁𝙄𝙉𝙄𝙏𝙀𝙇𝙔: snu.socratica.com/python Exceptions allow you to write code which may not work, and then handle the successful and failed cases separately. The four clauses in Python Exception handling are try, except, else, and finally. These give you the ability to handle an error (except), a success (else), or either (finally). Today we introduce the most common types of exceptions in Python, and then show you how to use all 4 exception clauses.
    To learn Python, start our Python Playlist HERE:
    bit.ly/PythonHelloWorld
    Subscribe to Socratica: bit.ly/1ixuu9W
    ♦♦♦♦♦♦♦♦♦♦
    We recommend:
    Python Cookbook, Third edition from O’Reilly
    amzn.to/2sCNYlZ
    The Mythical Man Month - Essays on Software Engineering & Project Management
    amzn.to/2tYdNeP
    Shop Amazon Used Textbooks - Save up to 90%
    amzn.to/2pllk4B
    ♦♦♦♦♦♦♦♦♦♦
    Ways to support our channel:
    ► Join our Patreon : / socratica
    ► Make a one-time PayPal donation: www.paypal.me/socratica
    ► We also accept Bitcoin @ 1EttYyGwJmpy9bLY2UcmEqMJuBfaZ1HdG9
    Thank you!
    ♦♦♦♦♦♦♦♦♦♦
    Connect with us!
    Facebook: / socraticastudios
    Instagram: / socraticastudios
    Twitter: / socratica
    ♦♦♦♦♦♦♦♦♦♦
    Python instructor: Ulka Simone Mohanty (@ulkam on Twitter)
    Written & Produced by Michael Harrison (@mlh496 on Twitter)
    ♦♦♦♦♦♦♦♦♦♦
    Yoda, Star Wars The Exhibition, Madrid
    commons.wikimedia.org/wiki/Fi...
    Author: Daniel Huntley
    ♦♦♦♦♦♦♦♦♦♦

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

  • @Socratica
    @Socratica  2 ปีที่แล้ว +5

    Wear a Socratica Python shirt for good luck coding: shop.socratica.com/products/python-by-socratica

  • @ama_cactus
    @ama_cactus 5 ปีที่แล้ว +157

    I swear I can't with these videos anymore.. Looooool '... where this mathematical sin was committed.' I absolutely love your videos, I'm glad to be a software engineer. These videos remind me of what programming should always be like, fun, mind boggling interesting and exciting.

  • @Socratica
    @Socratica  4 ปีที่แล้ว +82

    It's official! The Socratica Python Kickstarter was a success! Thank you to all of our supporters. Because of you, many more Python videos coming soon!! 💜🦉

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

      Applied Machine Learning in Python is coming?

    • @kritsaphongphuthibpaphaisi1509
      @kritsaphongphuthibpaphaisi1509 4 ปีที่แล้ว

      Yes please

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

      You go straight to the point , I love it , you don't have to say much, your concepts are clear and understandable, It took me one video to subscribe, Continue making these videos they are worth every second,🔥🔥🔥

  • @Max-qs7sd
    @Max-qs7sd 6 ปีที่แล้ว +42

    "I am not amused. The answer is i." 👌

  • @alfredaidoo4081
    @alfredaidoo4081 6 ปีที่แล้ว +63

    My goodness!. ..."for such a mathematical sin" i admire you a lot.

  • @FlyingTurtleLP
    @FlyingTurtleLP 6 ปีที่แล้ว +177

    Omg I thought this series was dead :O I'm very happy to see a new episode!

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

      Same here! Thanks! :)

  • @franco521
    @franco521 5 ปีที่แล้ว +20

    0:30 "letting them know what they could do with their division request" lmaoo

  • @luanvasconcelos5935
    @luanvasconcelos5935 6 ปีที่แล้ว +13

    This series is hands down the best content to learn python on youtube I've ever seen. I've been struggling a lot since I started to learn coding in python and I keep finding myself going through the episodes to check out its contents. 10/10 not pushing

  • @ianmubangizi6721
    @ianmubangizi6721 6 ปีที่แล้ว +214

    MoneyNotFound Error :-))

  • @RandomDude2008B
    @RandomDude2008B 6 ปีที่แล้ว +51

    I've been a developer focusing on Python for over 5 years & still watch every one of your videos. How I wish that this had been available when I was learning. Also because of your series, I started writing docstrings again! :-p

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

      How much money do u make as a python developer

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

      @@mabd7340 almost nobody just makes a living being a Python dev. You need to have several other languages like JS , react , C++ to get a real job
      Good luck

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

      @@OneManCanStopTheMotorOfWorld Get into Data Science or Data Engineering with python and you'll have a really good salary.

  • @AnEvolvingApe
    @AnEvolvingApe 6 ปีที่แล้ว +41

    These videos are so awesome on so many levels.

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

    I don't understand why people dislike this video! THIS IS AWESOME! This is the only youtube channel I know that teaches python in this kind of way, the FUN way

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

    As a CS student, I think this channel is underestimated!! OMG. This channel is amazing!!!!

  • @stephenc9398
    @stephenc9398 6 ปีที่แล้ว +18

    Try:
    watch_video()
    Except DistractionError:
    return("Became distracted by the attractive charismatic python tutor")

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

    This is one of the best python tutorials on the internet. We need more of these please

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

    This video is so fun, and the effort you put into these videos is SO appreciated. You earned a subscriber with this one, thank you for your exceptional work Sorocratica!!

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

    These are by far the best programming video productions I have ever seen

  • @Pop3455
    @Pop3455 6 ปีที่แล้ว +11

    I'm so happy to see more of this. Please keep it up, and when you run out of things with python, do another language. Thanks for this upload!!

  • @mau_lopez
    @mau_lopez 6 ปีที่แล้ว +11

    Great tutorials, definitely recommended ! Ulka's (the Presenter) explanations are really clear, besides she is funny and ... beautiful ! ; ) Subscribed !

  • @majumdarpromit
    @majumdarpromit 4 ปีที่แล้ว

    It is one of the best teaching videos i have ever seen. The way the young lady explains without unnecessary fussing around is simply awesome. Just enjoy the videos. Please also make vidoes on other topics as well. The clarity and smooth delivery is unrivaled in the Teaching Video catagory

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

    These videos are amazing. The content is very clearly presented. I just love the automaton-like delivery. She is awesome.

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

    This video series is absolutely fantastic and I enjoy watching episodes despite knowing most of their raw content already :)

  • @ianmubangizi6721
    @ianmubangizi6721 6 ปีที่แล้ว +5

    I thought you had forgotten about us - Good to see another great video from Socratica

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

    Seeing this series back just made my Friday night!

  • @NilsonLopes05
    @NilsonLopes05 4 ปีที่แล้ว

    The best explanation about exceptions that I've ever seen. Very clearly and precisely.

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

    This is the best channel to learn Python!

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

    These videos are lovely. This will definitely help with my training. I’m grateful for these videos.

  • @anikettiratkar
    @anikettiratkar 5 ปีที่แล้ว

    That's a brilliant way to demonstrate concepts.
    That's the reason why this is the only youtube channel on which I like every video I watch. And, probably, in future, when I start earning, I will stop raising MoneyNotFoundError. :)

  • @sshum00
    @sshum00 6 ปีที่แล้ว +9

    Might be a good idea to talk about context managers, a much much cleaner way to handle exceptions, entry points, exit points, and cleanup (such as closing a resource, whether it's a socket, file, or anything else)

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

    YAY - glad you are back - GREAT timing :)

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

    Now ... this is truly the best educational video I've ever seen on programming. Teasing and massively packed with knowledge, visually appealing and perfectly fitting music as cream on top. Hey, why isn't this on TV? Back in the 90s (Switzerland / Austria / maybe also Germany) we HAD this -- just way worse of course ;). CHEERS!

  • @keithlillis7962
    @keithlillis7962 4 ปีที่แล้ว

    Socratica ROCKS - excellent tutorials and dead-pan intelligent humour - More power to this channel!!

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

    Wow, what a great series! I'm definetly going to recommend this to my friend :) I hope new python tutorials are coming sometime soon (i see that this video didn't get much notice... but i enjoyed it a lot)

  • @ahmed.bhewary775
    @ahmed.bhewary775 5 ปีที่แล้ว +1

    guys where have you been ... I thought the series was over .... keep up the good work

  • @sdparsons
    @sdparsons 4 ปีที่แล้ว

    I wish there were more of these videos in this series - they are so useful and also hilarious

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

    the content, the explanations, and last but not least the humor. Please more of this :-)
    The "apparantly yoda never wrote code" line killed me xD

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

    Your explanation is just brilliant Socratica. Keep up the good work you nerds.

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

    Good to see you back again @Socratica

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

    I will continue to support you on TH-cam. You guys are awesome

  • @sagshah10
    @sagshah10 6 ปีที่แล้ว

    Who the hell dislikes such an entertaining and informative video. Anyways thanks a lot i am a new subscriber whose been enjoying watching your tutorials. Must say been very entertaining whilst educating for me, also in areas which I thought I already new. Thank you very much. :)

  • @pojntfxlegacy611
    @pojntfxlegacy611 6 ปีที่แล้ว +2

    Awesome! I've missed this so much!

  • @AbdennacerAyeb
    @AbdennacerAyeb 6 ปีที่แล้ว +7

    Great tutorials really; Thank you for sharing your knowledge

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

    Brilliantly presented. Love the humour as well. Thank you so much.

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

    Wow! Love Socratica, Love you Ulka!

  • @chadhanson3431
    @chadhanson3431 6 ปีที่แล้ว +2

    Welcome back!! Thank you!!!

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

    After sooooo long...Really feel alive now to see another episode of python:D @socratica

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

    Oh my goodness THIS IS EXCEPTIONAL! At the end of a long day of grinding I didn't think I could handle yet another Python video but, no, this is much more fun than watching Netflix. I absolutely love it.

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

      Good luck in your exams! We're rooting for you!! 💜🦉

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

    this must be one of my favorite youtube channels

  • @tendividedbysix4835
    @tendividedbysix4835 4 ปีที่แล้ว

    Hey, I've watched a few of your videos and they're brilliant! Please keep it up so I can show them to my kids when they're learning python 8 or something haha

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

    I love these videos. Very helpful and entertaining!!

  • @Vorstellungskraft1
    @Vorstellungskraft1 6 ปีที่แล้ว

    Great to see you are back!!!

  • @josephkimogele9988
    @josephkimogele9988 4 ปีที่แล้ว

    am so blessed this is the first video I am learning about exceptions on, so awesome

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

    Super video comme toujours. Avec des jolies jeux de mots à chaque fois. Great video madam :)

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

    Love your terse explanations - gets to the point, short & sweet ( with a nice dash of dry humor). Hope your Python tuts will go on!

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

      "Correction!" these are juicy-humours, 4real!!

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

    This is so good. SO GOOD

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

    This is a furiously underrated channel

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

    I am speechless after watching your videos. Loved them.

  • @MichaelGTadesse
    @MichaelGTadesse 4 ปีที่แล้ว

    Wow , very excellent and captivating video on exceptions - really like the way you explained - wonderful job!

  • @Socratica
    @Socratica  4 ปีที่แล้ว +20

    Welcome to Socratica! You can see our entire Python Playlist here: bit.ly/PythonSocratica
    Subscribe to see all our new videos! bit.ly/SocraticaSubscribe

    • @ankitSharma-dd2qz
      @ankitSharma-dd2qz 3 ปีที่แล้ว

      Can you also help me with OOPS concept in python

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

    Best python exception lesson I've watched so far on TH-cam!!!
    Well Explained, Really Funny Jokes...Thanks A Lot!

  • @liucloud6317
    @liucloud6317 4 ปีที่แล้ว

    I subscribed your channel right after I came across it on TH-cam. Your vides explain ideas concisely and clearly which outstanding among others. Thank you very much for creating those awesome videos!
    BTW, I have read some sad news regarding Coronavirus in Italy. I hope you all are fine and get through this tough time soon!

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

    I think I just found my favorite Python tutor. Also, I think I'm in love.

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

    This is super high quality stuff! Thanks a lot

  • @mowafagouli
    @mowafagouli 4 ปีที่แล้ว

    Anytime, Any time, please forgive my direct thing, but this is NOT a "Python", this is an ANACONDA.
    Excellent script, performance, delivery, you name it, the works. At the top of all Python videos.

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

    glad you're back!

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

    oh man, I was watching another video on this topic and it almost put me to sleep, how you describe things and your artistic flair makes it really enjoyable and understandable. Thank you so much.

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

      Thanks for your kind words! We have so much fun making these videos! 💜🦉

  • @tonysanchez9232
    @tonysanchez9232 6 ปีที่แล้ว +2

    Love this python series. I hope it keeps going!

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

      Oh, it will keep going, Tony! :) It will...

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

    Your method of teaching is very enthusiastic... it stimulates the passion to learn triggering everything...eish l can't explain you are too good

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

    Great content, graphics, concentrated ideas, and no smile robot mode is fabulous

  • @user-ur2en1zq4f
    @user-ur2en1zq4f 6 ปีที่แล้ว +6

    Oh my god!
    They're back.

  • @maimona1272
    @maimona1272 4 ปีที่แล้ว

    Found you today, and fell fo you today, you are AMAZING!

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

    ok, I had to pause the video, subscribe before continuing with the video. awesome

  • @carloshernandezperez6963
    @carloshernandezperez6963 4 ปีที่แล้ว

    I love your banter. Really useful videos too.

  • @rockstarwebdev
    @rockstarwebdev 6 ปีที่แล้ว

    Wonderful video!! programmers are trying all over the place! - Awesome!!

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

    Whoaaa I missed these tutorials!

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

    Great Video ... great video Socratica is a fantastic idea.

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

    U rock all the time... thanks for the video waiting for few more...

  • @HIDlarissaTERRY
    @HIDlarissaTERRY 4 ปีที่แล้ว

    Beautiful, thank you. Let’s learn, I need that!

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

    Socratica I just love you and your method of presentation on python.

  • @saritagupta8979
    @saritagupta8979 4 ปีที่แล้ว

    You are an amazing tutor with very good humor.

  • @sparrowhawkguitarboy
    @sparrowhawkguitarboy 4 ปีที่แล้ว

    Incredible series! I would like q similar series for the basics of vim

  • @brianaragon1641
    @brianaragon1641 4 ปีที่แล้ว

    Amazing concept... but I'm a beginner so I was little lost with the example... but I got very well the general concepts... reallly keep going!!

  • @wesleytaylor-rendal5648
    @wesleytaylor-rendal5648 2 ปีที่แล้ว

    Really high quality. Well done

  • @reach_perumal
    @reach_perumal 6 ปีที่แล้ว

    Best Python tut I ever seen...

  • @davidr.flores2043
    @davidr.flores2043 4 ปีที่แล้ว +1

    Excellent presentation. Great job.

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

    Wow your videos are really the best. TY keep them coming.

  • @ianmubangizi6721
    @ianmubangizi6721 6 ปีที่แล้ว +2

    Very time when I write a faction I remember Socratica and write a doc string after a lol!! :-))

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

    Thank you Socratica! :)

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

    When I was about to give up for python .. I got you 😌.
    Thanku ✨

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

    Nice videos ! Allow me to comment this one and mention that if you "return data" (or continue or break) in the try block, python leave the function and never execute the "else" block. But the finally block is always executed. So in your example, the open file is never closed.

  • @Albert-fe8jx
    @Albert-fe8jx 6 ปีที่แล้ว +2

    Great content. I am so happy it is offered pro bono.

  • @InternationalBigshot
    @InternationalBigshot 6 ปีที่แล้ว +2

    ...'you are trying, all over the place" Classic!

  • @ashlopez8221
    @ashlopez8221 5 ปีที่แล้ว

    These videos are the best!

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

    As always, hilarious and informative 😂

  • @UKImperium
    @UKImperium 4 ปีที่แล้ว

    Hi! First time viewer of your content! Love it. I love the sound of your voice. I'd love you to my virtual assistance

  • @zyadalharbi180
    @zyadalharbi180 4 ปีที่แล้ว

    I love the comedy in the tutorials. Thank you very much.

  • @foton3986
    @foton3986 4 ปีที่แล้ว

    Love these videos so cool hope to see more will def support

  • @jordanmoorman5024
    @jordanmoorman5024 6 ปีที่แล้ว

    wow, posted at 2 am. burning ye old candle at both ends to please the masses.

  • @yan-vn5oy
    @yan-vn5oy 2 ปีที่แล้ว

    Great video as always!!!

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

    Support what you love! Socratica has a Kickstarter to make more Python: bit.ly/PythonKickstarter