-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
STEP단계단계
Description
단계 설명
수학적 사고력을 길러 봅시다.
문제 / 코드보기
- 진법 변환 / 코드보기
- 진법 변환 2 / 코드보기
- 세탁소 사장 동혁 / 코드보기
- 중앙 이동 알고리즘 / 코드보기
- 벌집 / 코드보기
- 분수찾기 / 코드보기
- 달팽이는 올라가고 싶다 / 코드보기
- 큰 수 A+B / 코드보기
새로 알게된 점
-
진법 변환 (N진수 -> 10진수)
print(int('0b11001', 2)) # 25 print(int('0o31', 8)) # 25 print(int('0x19', 16)) # 25
-
진법 변환 (10진수 -> N진수)
함수를 따로 만들어 줘야한다.def solution(n, q): rev_base = '' while n > 0: n, mod = divmod(n, q) rev_base += str(mod) return rev_base[::-1] print(solution(45, 3))
-
진법 변환(10진수 -> 2, 8, 16진수)
print(bin(11)[2:]) # 1011 / 2진수 print(oct(11)[2:]) # 13 / 8진수 print(hex(11)[2:]) # b / 16진수