'''📌 왜 try-except를 쓸까?

프로그램을 실행하다가 에러가 나면 갑자기 종료돼요.

예를 들어:

숫자를 입력해야 하는데 문자를 입력하면?

0으로 나누면?

👉 프로그램이 멈춰버려요.

그래서 우리는 에러가 나도 프로그램이 안 멈추게 하기 위해
👉 try - except를 사용합니다.

try:
    실행할 코드
except:
    에러가 났을 때 실행할 코드'''
'''
try:
    a,b  = map(int,input().split())
    print(a+b)
except:
    print('입력값이 잘못되었습니다.')



dictionary = {'기린':'giraffe', '코끼리':'elephant', '개미':'ant'}
try:
    name = input()
    print(dictionary[name])
except:
    print('존재하지 않는 입력입니다.')

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: