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]


게시물: 59 건, 현재: 1 / 1 쪽
번호 제       목 작성자 등록일 방문
60  img2rgb.py PIL lambda print end prn sys.argv JMJS 24.6.18 2
59  cv2 image pixel bgr 값 수정하기 JMJS 24.3.1 30
58  글자피라미드 lpyramid.py JMJS 24.3.1 38
57  딕셔너리 dictionary 딕셔너리 key와 value 뒤집기 ... JMJS 24.3.1 36
56  bus idx2set cap JMJS 24.2.22 32
55  파이썬 리스트에서 빈 문자열인 원소 제거하기 JMJS 24.2.22 30
54  openpyxl JMJS 24.2.22 38
53  Decorators 데코레이터 JMJS 24.2.29 36
52  walrus operator := and for in list JMJS 24.2.1 38
51  pandas 행 추가 JMJS 24.1.28 41
50  split with brackets JMJS 24.1.27 47
49  이터레이터 Iterator JMJS 24.1.26 39
48  re regular expression JMJS 24.1.26 46
47  read_excel()의 지정 가능한 옵션 JMJS 24.1.26 39
46  pandas to_excel sheet 여러장 excel 파일 쓰기 읽기 JMJS 24.1.28 52
45  pandas 셀 isna isnull notna notnull JMJS 24.1.28 49
44  tkinter tk1.py JMJS 24.1.25 48
43  pandas _append df2.py JMJS 24.1.25 46
42  판다스 pandas DataFrame, list, dictionary, ... JMJS 24.1.25 43
41  f-string JMJS 24.6.18 83
40  pandas JMJS 24.1.17 43
39  __add__ __getattr__ __getitem__ __setitem__ JMJS 24.1.24 53
38  파이썬 설치경로 확인 JMJS 23.12.4 54
37  deepcopy JMJS 23.11.24 49
36  def func(*args): JMJS 23.11.24 53
35  sys.version_info JMJS 23.11.19 51
34  argparse add_argument parse_args JMJS 24.1.17 56
33  [bpy]bone2_wr.py JMJS 23.9.23 61
32  [bpy]bm.verts depsgraph JMJS 23.9.23 59
31  [bpy]keyframe_insert JMJS 23.9.23 59
30  [bpy]key_blocks JMJS 23.9.23 61
29  def abc (a=10,b=20,c=30) JMJS 23.8.1 77
28  shape prj JMJS 23.10.29 78
27  yaml JMJS 23.11.30 84
26  getopt arg argv JMJS 23.7.26 83
25  pg.mouse.get_pressed() pg.mouse.get_pos() JMJS 22.11.20 171
24  pg.MOUSEBUTTONDOWN event.button JMJS 22.11.20 154
23  모두의 파이썬 - 20일만에배우는 프로그래밍 기초 JMJS 20.1.8 196
22  python -m pip install -U pip JMJS 19.11.25 215
21  get =lambda i,m ... JMJS 19.11.13 221
20  2차원 리스트, 튜플 JMJS 19.11.13 208
19  [turtle]def polygon3(n,c,d) JMJS 19.11.11 228
18  [turtle]def polygon2(n,a) JMJS 19.11.11 215
17  def factorial(n) JMJS 19.11.11 212
16  def sum_func(n) JMJS 19.11.11 218
15  def hello() fun1(a) fun2(a,b) JMJS 19.11.11 213
14  while sum JMJS 19.11.11 211
13  random calculation JMJS 19.11.11 204
12  turtle random JMJS 19.11.11 207
11  import time time.time JMJS 19.11.11 203
10  turtle begin_fill end_fill JMJS 19.11.11 206
9  if else JMJS 19.11.11 203
8  input JMJS 19.11.11 210
7  list JMJS 24.3.1 220
6  turtle triangle JMJS 19.11.11 210
5  for range JMJS 19.11.11 206
4  모듈 사용하기 JMJS 19.11.11 205
3  import 파이썬 모듈 가져다 쓰기 JMJS 19.11.11 221
1  print 줄바꿈 JMJS 19.11.11 255
[1]