다음 코드를 사용하면 된다.



def getType(x):

    return {

        0: 'A',

        1: 'B',

        2: 'C'

    }[x]



>>> getType(0)

'A'



+ Recent posts