Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = input().upper()
- unique_symbols = ""
- current_symbol = ""
- repetitions = ""
- for i in range(len(text)):
- if not text[i].isdigit():
- current_symbol += text[i]
- else:
- for idx in range(i, len(text)):
- if not text[idx].isdigit():
- break
- repetitions += text[idx]
- repetitions = int(repetitions)
- unique_symbols += repetitions * current_symbol
- current_symbol = ""
- repetitions = ""
- print(f"Unique symbols used: {len(set(unique_symbols))}")
- print(unique_symbols)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement