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월

은행주 - 배당주 투자 일기, 2022.07.04(월)

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