Python Programming Tutorial #18 - Try and Except (Python Error Handling)

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 43

  • @teodorturcanu8515
    @teodorturcanu8515 Год назад +19

    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!

  • @jonathanedwardgoode
    @jonathanedwardgoode 2 года назад +7

    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?

    • @mordekai23
      @mordekai23 2 года назад +2

      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

    • @decone4839
      @decone4839 Год назад

      @@mordekai23 yo great answer

  • @ranahamzakhudadadkhan5632
    @ranahamzakhudadadkhan5632 Год назад +2

    real practical examples help to understand the purpose of the function and you did it....🙂 thanks

  • @Tracks777
    @Tracks777 7 лет назад +4

    When is your next video? :D Keep it up!

  • @Senzei_YT
    @Senzei_YT 3 года назад +8

    Great work broo. I was confused about this, you helped me a lot. You described it very clearly. THANKS. SUBSCRIBED

  • @keifer7813
    @keifer7813 2 года назад +2

    Nice and clear. Great video

  • @htetlwinkyaw2915
    @htetlwinkyaw2915 Год назад

    Thanks Tim, this tutorial helped me a lot.

  • @KBQuick81
    @KBQuick81 3 года назад +2

    Perfect and concise!

  • @vihashah5975
    @vihashah5975 5 лет назад +2

    Ur amazing! Thanks so much for these amazing tutorials.

  • @freedomtd
    @freedomtd 6 лет назад +5

    Hey man, great video. Thanks for posting it.

  • @addisumengistu4784
    @addisumengistu4784 3 года назад +7

    Who here noticed that he changed the position of Minecraft

  • @WanderfromSOTC
    @WanderfromSOTC Год назад

    Best tuts on yt!

  • @eswarspython2743
    @eswarspython2743 4 года назад +1

    Nice video
    Watched at 2x
    Meet you in next one

  • @morty6224
    @morty6224 4 года назад +8

    You play Minecraft, Nice

  • @How2Python.22
    @How2Python.22 3 месяца назад +1

    Nice video

  • @Itsyaboy_Jeff
    @Itsyaboy_Jeff 4 года назад +2

    Nice I got the 200th Like, So satisfying

  • @carlosz1858
    @carlosz1858 4 года назад

    thank you tim, you clear my doubts

  • @Random-nu3wx
    @Random-nu3wx 3 месяца назад

    great tutorial

  • @timmyhuynh3859
    @timmyhuynh3859 2 года назад

    Thank you very much for your video.

  • @justinsgotto5407
    @justinsgotto5407 29 дней назад

    very good

  • @luckie8377
    @luckie8377 5 лет назад +1

    great video

  • @PeenTip
    @PeenTip Год назад

    So under that except block can you do a print function for a user input to try again?

  • @keneflucas937
    @keneflucas937 10 месяцев назад

    If the 'try' function works, do you leave it in the program or do you replace it with an 'if' or something else...?

  • @Aaryan1176
    @Aaryan1176 2 года назад +1

    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

    • @memesick4ever
      @memesick4ever 2 года назад +1

      Try this:
      myList = [97,98,99,100]
      myList[1] = -40
      print(myList)

  • @exceptionalcow9365
    @exceptionalcow9365 5 месяцев назад

    u savedm y life

  • @eaglekraft687
    @eaglekraft687 6 месяцев назад

    so except and try go together

  • @chiragbhardwaj1732
    @chiragbhardwaj1732 2 года назад

    How is this any different than if-else?

  • @theironhunk69
    @theironhunk69 2 года назад

    "do or do not, there is no try"
    -yoda

  • @eaglekraft687
    @eaglekraft687 6 месяцев назад

    so what if you removed except?

  • @jordanping6192
    @jordanping6192 4 года назад +1

    can someone tell me the difference between this and the 'if' and 'else' statement?

    • @FutureProgrammer360
      @FutureProgrammer360 3 года назад +4

      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.

  • @sameer-vn3iq
    @sameer-vn3iq 26 дней назад

    its just "If and Else" why we have to use this??

  • @NotGhostCaos
    @NotGhostCaos 5 месяцев назад

    Still crashes bc it uses an excel file, I want to avoid crash when run and the file is open :(

  • @shivam9aa9
    @shivam9aa9 4 года назад +1

    this does not work...

  • @lezzure1559
    @lezzure1559 3 года назад

    Hat mir nicht geholfen. Hab lieber David gefragt.