python中,已经定义的列表运行后报错name 'income_list' is not defined 未定义??

代码如下

list1 = [['a1', '2020-01-01', '2000', 'x1'], ['a2', '2020-02-02', '200', 'x2'], ['a3', '2020-01-03', '2000', 'x3'], ['b1', '2020-04-04', '300', 'x4'], ['b2', '2020-05-10', '350', 'x5'], ['b3', '2020-06-07', '600', 'x6'], ['b4', '2020-01-08', '100', 'x7']]

def iemax():

    income_list = []
    expend_list = []   
    dictin = {}   
    dictex = {}
    jine = 0
    for i in range(0,len(list1)):
        name = list1[i][0][0]
        if name == 'a':
            jine = list1[i][2]
            income_list.append(jine)
            dictin.setdefault(list1[i][0],list1[i][2])
        elif name == 'b':
            jine = list1[i][2]
            expend_list.append(jine)
            dictex.setdefault(list1[i][0],list1[i][2])
iemax()

运行后不报错。但输入income_list, expend_list, dictin, dictex试图查看内容

均报错
name 'income_list' is not defined ,

请问有人知道是为什么吗?我在函数中不是已经定义过了吗

图片说明