1. open(0) : 표준 입력(stdin)2. lines = [*open(0)] : 한 줄 씩 읽어서 리스트로 저장,= input().splitlines()3.언패킹*: 공백으로 구분된 형태로 출력- print(*sorted_numbers)lines = [*open(0)]numbers = map(int, lines[1:]) # 첫 줄 제외하고 숫자만sorted_numbers = sorted(numbers)print(*sorted_numbers) 4. cmp_to_keyfrom functools import cmp_to_key# cmp_to_key 내부 원리를 단순화한 예시def cmp_to_key(mycmp): class K: def __init__(self, obj): ..
1. random- random.randrange(a,b): a이상 b미만의 수 중 무작위로 하나 반환 2. math- math.pi= 파이(=3.14...)- math.e = e(=2.71...)- math.log(b,a) : a^x = b 일때, x = log(a)b- math.factorial(n) 3. time- time.ctime(): 요일 "월 일 시간 년" 순으로 현재 시간을 문자열로 반환 4. urllib- urlopen(): 해당url의 html 파일을 가져옴 - read(): 결과를해독해 문자열로 반환- decode(): 문자열을 특정 인코딩 방식으로 해독from urllib.request import urlopenurl = 'https:example.com'webpage = urlop..
- Total
- Today
- Yesterday
- 운동
- 기초
- Python
- 고득점 Kit
- opic
- 아침
- C언어
- 영어회화
- Ai
- 루틴
- 다이어트
- 프로그래머스
- 30분
- 경제
- 줄넘기
- 오픽
- 습관
- 미라클모닝
- 실기
- 아침운동
- IH
- 오블완
- llm
- SQL
- 뉴스
- 갓생
- 티스토리챌린지
- 스크랩
- 빅데이터 분석기사
- ChatGPT
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |