일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- suninatas 풀이
- 함수
- 백준 알고리즘
- 객체
- python
- 메소드
- property
- 백준 파이썬
- document
- 자바스크립트
- 사칙연산
- element 조회
- 배열
- jQuery
- sql injection
- 조건문
- blind sql injection
- github
- IF문
- 포인터
- xss game 풀이
- burp suite
- 김성엽 대표님
- lord of sql injection
- 파이썬
- htmlspecialchars
- window
- xss game
- Pwndbg
- object
Archives
- Today
- Total
power-girl0-0
하노이의 탑 본문
728x90
def hanoi(ndisks, startPeg=1, endPeg=3):
if ndisks:
hanoi(ndisks-1, startPeg, 6-startPeg-endPeg)
print(startPeg, "번의 기둥의", ndisks, "번 고리를", endPeg, "번 기둥에 옮깁니다.")
hanoi(ndisks-1, 6-startPeg-endPeg, endPeg)
hanoi(ndisks=3)
728x90
'언어 > Python' 카테고리의 다른 글
Python 개요 (0) | 2020.12.16 |
---|---|
성적입력받아 최대값과 최소값 차이 구하기 (0) | 2020.12.02 |
사칙연산 (0) | 2020.10.06 |
사각형의 넓이 구하기 (0) | 2020.10.06 |
함수 실습 (0) | 2020.10.06 |
Comments