Python Operators 썸네일형 리스트형 [코딩테스트 입문] 개미 군단 개미 군단 1안) solution.py def solution(hp): answer = 0 a = hp // 5 b = (hp % 5) // 3 c = (hp % 5) % 3 answer = a + b + c return answer 2안) solution.py def solution(hp): answer = 0 answer = (hp // 5) + ((hp % 5) // 3) + ((hp % 5) % 3) return answer 3안) solution.py def solution(hp): answer = 0 a = divmod(hp, 5) b = divmod(a[1], 3) c = divmod(b[1], 1) answer = a[0] + b[0] + c[0] return answer 4안) solut.. 더보기 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 다음