상세 컨텐츠

본문 제목

Multiple Argument

Python

by techbard 2016. 4. 28. 18:08

본문

반응형

# Multiple Argument


def main():

myFunc(1, 2, 3, 4, 5)


# multiple argument

def myFunc(one, two, *args):

print("the values are {} {} {}".format(one, two, args))


ourFunc(1, 2, 3, 4, 5, 6, onee = "Monday", twoo = "Tuesday")


#Key Word Arguments

def ourFunc(a, b, c, *args, **kwargs):

print("hello", kwargs['onee'], kwargs['twoo'])


if __name__ == "__main__": main()


# 결과

the values are 1 2 (3, 4, 5)

hello Monday Tuesday


반응형

관련글 더보기

댓글 영역