Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import math
- # Auto-generated code below aims at helping you parse
- # the standard input according to the problem statement.
- message = input()
- s = ""
- f = ""
- for c in message:
- b = bin(int(ord(c)))[2:]
- if len(b) % 7 != 0:
- temp = "0" * (7-(len(b)%7))
- temp += b
- b = temp
- s += b
- i=0
- while i < len(s):
- if s[i] == '1':
- f += "0 0"
- else:
- f += "00 0"
- c = 0
- while i < len(s)-1 and s[i] == s[i+1]:
- c+= 1
- i+=1
- f += ("0" * c) + " "
- i += 1
- print(f.rstrip())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement