Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string_list = input()
- string4 = str()
- letter = list(string4)
- for i in range(ord('a'), ord('z')+1):
- letter.insert(i,chr(i))
- string5 = str()
- digit = list(string5)
- for i in range(int(0), int(9)+1):
- digit.insert(i,str(i))
- other = not in (digit + letter)
- letter_count = 0
- digit_count = 0
- other_count = 0
- is_previous_digit = False
- new_list = []
- for a in string_list :
- if a is letter :
- new_list.append(a)
- letter_count += 1
- is_previous_digit = False
- elif a is digit and not is_previous_digit:
- new_list.append('#')
- digit_count += 1
- is_previous_digit = True
- elif a is other and not is_previous_digit:
- new_list.append('@')
- other_count += 1
- is_previous_digit = False
- print(letter_count)
- print(digit_count)
- print(other_count)
- print(new_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement