Advertisement
bl00dt3ars

09. Rage Quit

Jul 28th, 2021
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. string = input().upper()
  2. unique_symbols = len(set([el for el in string if not el.isdigit()]))
  3. print(f'Unique symbols used: {unique_symbols}')
  4.  
  5. symbols = ''
  6. digits = ''
  7. for char in range(len(string)):
  8.     if string[char].isdigit():
  9.         digits += string[char]
  10.         if char + 1 < len(string) and not string[char+1].isdigit() or char + 1 == len(string):
  11.             print(symbols * int(digits), end='')
  12.             symbols = ''
  13.             digits = ''
  14.     else:
  15.         symbols += string[char]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement