You are on page 1of 1

Daum Tistory

JH PROJECT

Python - *, ** ? (*args, **kwargs)


IT/Python 2013.12.24 21:00
: http://stackoverflow.com/questions/3394835/args-and-kwargs

python
*args, **kwargs .
" "
.

purepleya
*args
- . args .
)

1 def print_param(*args): ?
2 print args
3 for p in args:
4 print p
5 (148)
6 print_param('a', 'b', 'c', 'd')
7 #('a', 'b', 'c', 'd') JH PROJECT (2)

8 #a IT (146)
9 #b
10 #c
11 #d

Matcher TourtToBee google app


**kwargs engine GAE nosql
- . kwargs . diamond operator JavaScript column
family html5 NDB
1 def print_param2(**kwargs): ?
2 print kwargs jQuery
3 print kwargs.keys() keyspace java css3
4 print kwargs.values() layout django cql apache hadoop
5
6 for name, value in kwargs.items(): oauth TABLE Map Cassandra
7 print "%s : %s" % (name, value)
8 Python datastore Navigation
9 print_param2(first = 'a', second = 'b', third = 'c', fourth = 'd') timezone
10
11 #{'second': 'b', 'fourth': 'd', 'third': 'c', 'first': 'a'}
12 #['second', 'fourth', 'third', 'first']

13 #['b', 'd', 'c', 'a']
14 #second : b JavaScript...
15 #fourth : d
by purepleya
16 #third : c
17 #first : a ...
by purepleya
for each .
by purepleya
?? (Diamon...
by purepleya
1 def print_param3(*args, **kwargs): ?
2 print args Java .
3 print kwargs by purepleya
4
5 print_param3('a', 'b')
6 #('a', 'b')
7 #{}
8 .. ...
9 print_param3(third = 'c', fourth = 'd') 2016
10 #()
11 #{'fourth': 'd', 'third': 'c'} . ...
12 purepleya 2015
13 print_param3('a', 'b', third = 'c', fourth = 'd')
14 #('a', 'b')
15 #{'fourth': 'd', 'third': 'c'}



2014/11 (1)
1 def print_param4(a, b, c): ? 2014/09 (1)
2 print a, b, c 2014/03 (1)
3
4 p = ['a', 'b', 'c'] 2014/02 (20)
5 print_param4(*p) 2014/01 (11)
6 #a b c
7
8 p2 = {'c' : '1', 'a' : '2', 'b' : '3'}
9 print_param4(**p2)
10 #2 3 1 2017/03

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

' I T > P y t h o n'


Python - , , , , , (yyyymmddhh24miss ) (0) 2014.01.08 Total : 42,025


2014.01.08 Today : 45 Yesterday : 50
Python - ASCII , ASCII (0)
Python - *, ** ? (*args, **kwargs) (0) 2013.12.24

Python - filter() (0) 2013.12.20


!
Python - map() (0) 2013.12.20

Python - lambda() (0) 2013.12.20

Posted by purepleya

*args, *kwargs, Python

, .

1 ... 37 38 39 40 41 42 43 44 45 ... 148

: : : :
purepleya's Blog is powered by Daum / Designed by Tistory

You might also like