Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- def main():
- s = input("Vnesi string: ")
- i = 0
- res = ""
- while i < len(s):
- cnt = 0
- for j in range(i, len(s)):
- if s[i] != s[j]:
- break
- cnt += 1
- res += str(cnt) + s[i]
- i += cnt
- print(res)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement