일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 처우산정
- 연결요소
- msSQL
- 처우협의
- 백준
- 소프티어
- dfs
- Docker
- softeer
- 물채우기
- Kafka
- 이분탐색
- 매개변수탐색
- 기술면접
- 퇴사통보
- compose
- boj #19237 #어른 상어
- 백트래킹
- 성적평가
- @P0
- BFS
- 13908
- 오퍼레터
- 경력
- OFFSET
- upper_bound
- 파라메트릭
- incr
- 6987
- BOJ
- Today
- Total
목록Python (7)
기술 블로그
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 # coding: utf-8 # In[10]: matrix = [[0 for col in range(10)] for row in range(10)] # In[12]: square = lambda x:x**2 # x를 받아서, x의 제곱(2)을 반환 -> 입력:출력 (return 표시x)..
lambda 람다 활용 1234567891011121314151617181920212223242526272829303132333435363738import requestsfrom bs4 import BeautifulSoup# 위의 두 모듈이 없는 경우에는 pip install requests bs4 실행 def get_news_content(url): response = requests.get(url) content = response.text soup = BeautifulSoup(content, 'html5lib') div = soup.find('div', attrs = {'id' : 'harmonyContainer'}) content = '' for paragraph in div.find_all('p..
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816..
class 연산자 재정의 __init__ __add__ 등등 p1 = p2 + p3의 형식 https://docs.python.org/3/reference/datamodel.html 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162import math class Point : def __init__(self, x, y) : self.x = x self.y = y def __add__(self, pt) : new_x = self.x + pt.x new_y = self.y + pt.y return Point(new_x, new_y) def __sub__..
class 상속, super 1234567891011121314151617181920212223242526class Person : def __init__(self, name, age) : self.name = name self.age = age def eat(self, food) : print('{}은 {}를 먹습니다.'.format(self.name, food)) def sleep(self, minute) : print('{}은 {}분 동안 잡니다.'.format(self.name, minute)) def work(self, minute) : print('{}은 {}분 동안 일을 합니다.'.format(self.name, minute)) class Student(Person) : def __init_..
class staticmethod 12345678910class Math : @staticmethod def add(a, b) : return a + b @staticmethod def multi(a, b) : return a * b Math.add(10, 20)cs
class self 12345678910111213class person : def __init__(self, name, age = 10) : #print(self, 'is generated') self.name = name self.age = age p1 = person('Bob', 30)p2 = person('Kate', 20)p3 = person('Candy') print(p1.name, '은 ', p1.age, '살이다.')print(p2.name, '은 ', p2.age, '살이다.')print(p3.name, '은 ', p3.age, '살이다.')cs