Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- u = '1000111001'
- u = '11011'
- result = ""
- while u:
- if u.startswith("000"):
- result += '333'
- u = u[3:]
- elif u.startswith("00"):
- result += '22'
- u = u[2:]
- elif u.startswith("0"):
- result += '1'
- u = u[1:]
- elif u.startswith("11"):
- result += '-'
- u = u[2:]
- elif u.startswith("1"):
- result += '.'
- u = u[1:]
- print(result)
Add Comment
Please, Sign In to add comment