Advertisement
Darlexbg

09. Rage Quit

Oct 22nd, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. word = input()
  2. string = ''
  3. rage_quit_message = ''
  4.  
  5. for i in range(len(word)):
  6.     if word[i].isdigit():
  7.         count_str = word[i]
  8.         if i + 1 < len(word) and word[i + 1].isdigit():
  9.             count_str += word[i + 1]
  10.         count = int(count_str)
  11.         rage_quit_message += string.upper() * count
  12.         string = ''
  13.     else:
  14.         string += word[i]
  15.  
  16. symbols_count = (len(set(rage_quit_message)))
  17. print(f"Unique symbols used: {symbols_count}")
  18. print(rage_quit_message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement