#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http

제목작년 중간 기출 9번2023-04-16 18:19
작성자
def function09(*a, **b):
    if not b:
        return -1
    else:
        '''MAX = max(b)
        result = b.get(MAX)  
        '''
        # 위에 걸로 하면 4번쨰 식에서 4가 나온다. Why?
        
        S = set(b.values())
        result = max(S)
        return result
초록색 부분으로 함수를 만들면 
print(function09(1,2,7,n1=5,n2=4)를 했을 때 4가 나옵니다.
이유가 뭘까요?
 
#기출#dict
댓글
이전Practice11질문이 있습니다.2023-04-16
다음set[]2023-04-16