LogIn E-mail
설계이야기
args kwargs
# 33 jinsung    70.1.1 09:00

def myFunc(*args):
    for arg in args:
        print(arg)
myFunc(10, 20, 'a')

p1 = [10, 20, 'a']
myFunc(*p1)


def myFunc(**kwargs):
    for item in kwargs.items():
        print(item)

myFunc(x=100, y=200, z='b')


def myFunc(*args, **kwargs):
    for arg in args:
        print(arg)
    for item in kwargs.items():
        print(item)    

myFunc(10, 20, 'a',x=100, y=200, z='b')

p1 = [10, 20, 'a']
myFunc(*p1,x=100, y=200, z='b')

게시물: 33 건, 현재: 1 / 1 쪽
[1]
번호 제       목 작성자 등록일 방문
34  sys.argv jinsung 22.4.1 27
33  args kwargs jinsung 22.4.1 28
32  set 집합 jinsung 22.3.24 29
31  getopt - 명열 줄 옵션용 c 스타일 구문 JMJS 22.4.1 63
30  tuple 은 수정 못함 jinsung 21.11.6 95
29  ocr cv2 py jinsung 21.9.17 131
28  PIL to numpy jinsung 21.9.15 121
27  pygame.display.flip vs pygame.display.update jinsung 21.9.6 160
26  house.py jinsung 21.3.18 275
25  move_circle_j1.py jinsung 21.3.18 228
24  bounce_j1.py jinsung 22.2.15 219
23  모두의 파이썬 - 20일만에배우는 프로그래밍 기초 JMJS 20.1.8 404
22  python -m pip install -U pip , matplotlib arcade ... jinsung 22.4.15 332
21  get =lambda i,m ... JMJS 19.11.13 328
20  2차원 리스트, 튜플 jinsung 21.11.6 348
19  [turtle]def polygon3(n,c,d) JMJS 19.11.11 326
18  [turtle]def polygon2(n,a) JMJS 19.11.11 320
17  def factorial(n) JMJS 19.11.11 294
16  def sum_func(n) JMJS 19.11.11 339
15  def hello() fun1(a) fun2(a,b) JMJS 19.11.11 323
14  while sum JMJS 19.11.11 285
13  random calculation JMJS 19.11.11 295
12  turtle random JMJS 19.11.11 301
11  import time time.time JMJS 19.11.11 303
10  turtle begin_fill end_fill JMJS 19.11.11 293
9  if else JMJS 19.11.11 290
8  input JMJS 19.11.11 299
7  list JMJS 19.11.11 313
6  turtle triangle JMJS 19.11.11 299
5  for range JMJS 19.11.11 295
4  모듈 사용하기 JMJS 19.11.11 302
3  import 파이썬 모듈 가져다 쓰기 JMJS 19.11.11 320
1  print 줄바꿈 JMJS 19.11.11 359
[1]