Created
January 21, 2015 10:42
-
-
Save KimBoWoon/b57c5f60d9aed1825293 to your computer and use it in GitHub Desktop.
10진수를 입력받아 16진수로 변환
출력문이 맘에 안
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
__author__ = 'user' | |
string = "0123456789ABCDEF" | |
Q = list() | |
userInput = input("Input : ") | |
while (True): | |
Q.append(int(userInput) & 0xf) | |
userInput = int(userInput) >> 4 | |
if (int(userInput) == 0): | |
break | |
Q.reverse() | |
for x in Q: | |
print(string[x]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment