분류 전체보기 썸네일형 리스트형 [코딩테스트 입문] 분수의 덧셈 분수의 덧셈 1안) solution.py import math def solution(denum1, num1, denum2, num2): answer = [] bottom = num1 * num2 top = denum1 * num2 + denum2 * num1 n = math.gcd(top, bottom) if n == 1: answer = [top, bottom] else: answer = [top/n, bottom/n] return answer 출처 - 프로그래머스(코딩테스트 연습) : https://school.programmers.co.kr/learn/courses/30/lessons/120808 분수의 덧셈과 뺄셈 그리고 기약분수 분수의 덧셈은 분모의 통분 후 더하기 참고URL - python(.. 더보기 [코딩테스트 입문] 편지 편지 1안) solution.py def solution(message): answer = 0 answer = len(message) * 2 return answer 2안) solution.py def solution(message): answer = 0 assert 1 더보기 python 연산자(Python Operators) python 연산자(Python Operators) 산술 연산자(Arithmetic operators) 할당 연산자(Assignment operators) 비교 연산자(Comparison operators) 논리 연산자(Logical operators) 식별 연산자(Identity operators) 멤버 연산자(Membership operators) 비트 연산자(Bitwise operators) 산술 연산자(Arithmetic operators) x = 5, y = 3 Operator Name Example + 더하기(Addition) x + y → 8 - 빼기(Subtraction) x - y → 2 * 곱하기(Multiplication) x * y → 15 / 나누기(Division) x / y →.. 더보기 [코딩테스트 입문] 양꼬치 양꼬치 1안) solution.py def solution(n, k): answer = 0 answer = n * 12000 + (k - (n // 10)) * 2000 return answer 2안) solution.py def solution(n, k): answer = 0 if (n 1000): raise ValueError if (k 1000): raise ValueError answer = n * 12000 + (k - (n // 10)) * 2000 return answer 출처 - 프로그래머스(코딩테스트 연습) : https://school.programmers.co.kr/learn/courses/30/lessons/120830 더보기 [코딩테스트 입문] 중복된 숫자 개수 중복된 숫자 개수 1안) solution.py def solution(array, n): answer = 0 answer = array.count(n) return answer 2안) solution.py def solution(array, n): answer = 0 if (len(array) 100): raise ValueError("length of array") if (max(array) 1000): raise ValueError("maximum value of an element") if (n 1000): raise ValueError("parameter value") answer = array.count(.. 더보기 [코딩테스트 입문] 짝수의 합 짝수의 합 solution.py def solution(n): answer = 0 if (0 < n 더보기 [코딩테스트 입문] 배열의 평균값 배열의 평균값 1안) solution.py def solution(numbers): answer = 0 answer = sum(numbers) / len(numbers) return answer 2안) solution.py def solution(numbers): answer = 0 for number in (numbers): count = 0 count += 1 if 0 더보기 [kubernetes] kubectl config 명령 - 1 쿠버네티스 kubectl config 명령 Modify kubeconfig files using subcommands like "kubectl config set current-context my-context" 사용법 The loading order follows these rules: 1. If the --kubeconfig flag is set, then only that file is loaded. The flag may only be set once and no merging takes place. 2. If $KUBECONFIG environment variable is set, then it is used as a list of paths (normal path delimiting rules.. 더보기 이전 1 ··· 131 132 133 134 135 136 137 ··· 298 다음