Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- new_string = ''
- result = ''
- lst = []
- for _ in range(n):
- number = int(input())
- result += hex(number)
- lst = result.split('x')
- new_string += lst[-1]
- final_string = ''
- for i in range(len(new_string)-1):
- counter = 1
- if new_string[i] == new_string[i+1]:
- counter += 1
- final_string += str(counter)
- final_string += ' '
- print(final_string)
Advertisement
Add Comment
Please, Sign In to add comment