일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- extends
- Stream
- finalize
- Wrapper class
- has-a
- Java
- 스트림
- constructor
- dbeaver
- 얕은 복사
- 셔뱅
- 자바
- parameter group
- 깊은 복사
- Up Casting
- lambda
- identityHashCode
- 엔드포인트
- generic programming
- node.js
- Inbound
- 파이참
- singletone
- down casting
- shebang
- public static final
- 내부클래스
- pycharm
- access modifier
- arraycopy
- Today
- Total
목록Computer Science (63)
٩(๑•̀o•́๑)و
# tuple -> immutable! #1. count, index, map for i in range(2): a = tuple(map(int, input().split())) if a.count(30) > 0: print(a.index(30)) else: print('Not Found') ====Result==== 1 3 6 8 Not Found 2 5 4 20 30 4 #2. tuple 표현식 tuple(식 for 변수 in 리스트 if 조건식) a = tuple(i for i in range(10) if i%3 == 0) print(a) b = tuple(i+3 for i in range(6) if i%2 == 0) print(b) ====Result==== (0, 3, 6, 9) (3, 5, 7)
list(map(함수, 리스트)) tuple(map(함수, 튜플)) a = (2.3, 3, 4.7, 5.2) b = list(map(str, a)) c = tuple(map(int, a)) print('a : ', a) print('b : ', b) print('c : ', c) ====Result==== a : (2.3, 3, 4.7, 5.2) b : ['2.3', '3', '4.7', '5.2'] c : (2, 3, 4, 5) # map & input & split a = map(int, input().split()) print(list(a)) b = list(map(str, input().split(','))) print(b) ====Result==== 1 2 3 4 5 [1, 2, 3, 4, 5]..
#1. append a = [10, 20, 30] a.append(50) #a[len(a):] = [50] 와 동일 print(a, ', length : ', len(a)) a.append([40, 2]) # a[len(a):] = [[40, 2]] 와 동일 print(a, ', length : ', len(a)) ====Result==== [10, 20, 30, 50] , length : 4 [10, 20, 30, 50, [40, 2]] , length : 5 #2. extend a = [10, 20, 30] a.extend([50,60]) print(a,', length : ',len(a)) ====Result==== [10, 20, 30, 50, 60] , length : 5 #3. insert a..
i = 0 while True: i += 1 if i == 10: break elif i % 2 == 0: continue print(i) ====Result==== 1 3 5 7 9
i = 0; while i
#1. for & range for x in range(5): #0~4 print('hello', x, sep='') ====Result==== hello0 hello1 hello2 hello3 hello4 #2. for & reversed print('Example1') for x in range(3, 6): #3,4,5 print(x, end='/') print('\nreversed') for x in reversed(range(3, 6)): #5,4,3 print(x, end='/') print('\n\nExample2') for x in range(0,7,2): #0,2,4,6 print(x, end='/') print('\nreversed') for x in reversed(range(0,7,2..
# if x = True if x is False: print('True입니다') print('indentation') print('no indentation') ====Result==== no indentation x = True if x is True: pass print('pass') ====Result==== pass x = 34 if x>10: print('x>10') if x>20: pass if x>30: print('x>30') print('end') ====Result==== x>10 x>30 end x = 25 # if x>10 and x20: print('x>20') else: print('x
# dictionary type = { key1:value1, key2:value2 } kim = {'age': 26, 'sex': 'M', 'height': 180} print(kim) lee = {'age': 25, 'sex': 'F', 'height': 160, 'height': 165} print(lee) #key가 중복되는 경우: 가장 뒤에 있는 값만 사용 ====Result==== {'age': 26, 'sex': 'M', 'height': 180} {'age': 25, 'sex': 'F', 'height': 165} dic = {'one': 1, 0: False, 3.5: [3, 4], 4: (3, 4), 'r': range(3)} print(dic) dict1 = {'dic1': 1, 'd..