Created
June 2, 2016 13:34
-
-
Save yuda110/5e86162ff8b0f697ff87d105f7048d6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import product | |
def change124(n): | |
count = 1 | |
digit = 1 | |
while count != n : | |
for i in product('124', repeat=digit): | |
cur_num = ''.join(i) | |
if count == n : | |
break | |
count += 1 | |
digit += 1 | |
return cur_num | |
# 아래는 테스트로 출력해 보기 위한 코드입니다. | |
print(change124(10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment