Python, in the case of a def has 2 returns

def func(a, b):
    return a+b
    return a-b
print(func(4, 2))
# 6
# not 6 2

# Even if a function has 2 returns, we only get the first one.
# And the function processing ends after the first return. 

댓글

이 블로그의 인기 게시물

<배당주 투자> 지주사, '22년 8월

<배당주 투자> ETF, ETN, '22년 9월

<배당주 투자> 분기배당주 '22년 10월