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 …

source

47 Comments

  1. try:
    a = [1,'1',3]
    for i in a:
    return (i**2)
    except:
    print('wrong.')
    else:
    print(a)
    finally:
    print('always.')

    I am new. Can anyone explain why its not print 'Wrong' and not considering that return as an error?

  2. 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!! <3

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

Leave A Reply

Please enter your comment!
Please enter your name here