要求:捕获IndexError、TypeError、ValueError错误

要求:捕获IndexError、TypeError、ValueError错误,求求求求求求求求求求求求

img


def test_index(string,index):
    print(string[index])

str_x=''
num = 0
try:
    str_x = input() #ValueError
    num = input()  #TypeError
    num = int(input()) #indexerror
    test_index(str_x,num)
    str_x +num
except IndexError as e:
    print(e)
except TypeError as e:
    print(e)
except ValueError as e:
    print(e)
finally:
    pr

是桂医的么?