Skip to main content
Skip table of contents

인수 모드

기능

기본 인수 값, 키워드 인수, 가변 인수를 사용합니다.

예제

PY
def fn_Times(a = 10, b = 20):
return a * b

#Example - Default parameter value
tp_log(str(fn_Times(5)))
#expected result: 100

#Example - Keyword parameter
tp_log(str(fn_Times(b=5)))
#expected result: 50
tp_log(str(fn_Times(a=5, b=5)))
#expected result: 25

#Example - arbitary parameter
def fn_myUnion(*args):
for arg in args:
tp_log(str(arg))
fn_myUnion("red", 1)
#expected print result: red 
# 1

예제 - 기본 인수 값

PY
def fn_Times(a = 10, b = 20):
return a * b

fn_Times(5)

예제 - 키워드 인수

PY
def fn_Times(a = 10, b = 20)
	return a * b

fn_Times(a=5, b=5)

예제 - 가변 인수

PY

def fn_myUnion(*ar)
	…….

fn_myUnion("red", "white", "black")
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.