Skip to main content

Try .. Except

Published 1 min readMarkdown
Part of seriesPython

Try and except

a = 10
b = 0
print(a/b)

it shows ZeroDivisionError.

try:
    print(a/b)
except:
    print('0으로는 나눌 수 없어요!')

Python will print it instead of ZeroDivisionError.

No comments yet. Be the first to comment.

More from this blog