LogIn E-mail
설계이야기
get =lambda i,m ...
# 21 JMJS    19.11.13 11:07

>>> get = lambda i,m: m if not i else get(i[1:], m[i[0]])

>>> matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> idx = (1,2)
>>> get(idx, matrix)
6


>>> def hap(x, y):
...   return x + y
...
>>> hap(10, 20)
30

>>> (lambda x,y: x + y)(10, 20)
30


>>> map(lambda x: x ** 2, range(5))             # 파이썬 2
[0, 1, 4, 9, 16]  
>>> list(map(lambda x: x ** 2, range(5)))     # 파이썬 2 및 파이썬 3
[0, 1, 4, 9, 16]


게시물: 37 건, 현재: 1 / 1 쪽
번호 제       목 작성자 등록일 방문
38  파이썬 설치경로 확인 JMJS 23:21 7
37  deepcopy JMJS 23.11.24 7
36  def func(*args): JMJS 23.11.24 7
35  sys.version_info JMJS 23.11.19 7
34  argparse add_argument parse_args JMJS 23.11.17 8
33  [bpy]bone2_wr.py JMJS 23.9.23 19
32  [bpy]bm.verts depsgraph JMJS 23.9.23 19
31  [bpy]keyframe_insert JMJS 23.9.23 19
30  [bpy]key_blocks JMJS 23.9.23 22
29  def abc (a=10,b=20,c=30) JMJS 23.8.1 39
28  shape prj JMJS 23.10.29 38
27  yaml JMJS 23.11.30 42
26  getopt arg argv JMJS 23.7.26 41
25  pg.mouse.get_pressed() pg.mouse.get_pos() JMJS 22.11.20 130
24  pg.MOUSEBUTTONDOWN event.button JMJS 22.11.20 111
23  모두의 파이썬 - 20일만에배우는 프로그래밍 기초 JMJS 20.1.8 156
22  python -m pip install -U pip JMJS 19.11.25 173
21  get =lambda i,m ... JMJS 19.11.13 178
20  2차원 리스트, 튜플 JMJS 19.11.13 166
19  [turtle]def polygon3(n,c,d) JMJS 19.11.11 187
18  [turtle]def polygon2(n,a) JMJS 19.11.11 173
17  def factorial(n) JMJS 19.11.11 172
16  def sum_func(n) JMJS 19.11.11 179
15  def hello() fun1(a) fun2(a,b) JMJS 19.11.11 174
14  while sum JMJS 19.11.11 171
13  random calculation JMJS 19.11.11 165
12  turtle random JMJS 19.11.11 167
11  import time time.time JMJS 19.11.11 163
10  turtle begin_fill end_fill JMJS 19.11.11 166
9  if else JMJS 19.11.11 163
8  input JMJS 19.11.11 167
7  list JMJS 19.11.11 172
6  turtle triangle JMJS 19.11.11 167
5  for range JMJS 19.11.11 163
4  모듈 사용하기 JMJS 19.11.11 164
3  import 파이썬 모듈 가져다 쓰기 JMJS 19.11.11 178
1  print 줄바꿈 JMJS 19.11.11 205
[1]