Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def N(x):
- n = ""
- if not x:
- return 0
- while x > 0:
- a = str(x % 16)
- n = c[a] + n
- x = x // 16
- return n
- c= {'0': '0', '1':'1', '2':'2', '3':'3', '4':'4', '5':'5', '6':'6', '7':'7', '8':'8', '9':'9', '10':'A', '11':'B', '12':'C', '13':'D', '14':'E', '15':'F'}
- b = int(input())
- if b >= 0:
- print(N(b))
- else:
- print('-', N(-b), sep ="")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement