Advertisement
Guest User

gg

a guest
Dec 10th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. string_list = input()
  2. string4 = str()
  3. letter = list(string4)
  4. for i in range(ord('a'), ord('z')+1):
  5. letter.insert(i,chr(i))
  6.  
  7. string5 = str()
  8. digit = list(string5)
  9. for i in range(int(0), int(9)+1):
  10. digit.insert(i,str(i))
  11.  
  12. other = not in (digit + letter)
  13.  
  14. letter_count = 0
  15. digit_count = 0
  16. other_count = 0
  17. is_previous_digit = False
  18. new_list = []
  19. for a in string_list :
  20. if a is letter :
  21. new_list.append(a)
  22. letter_count += 1
  23. is_previous_digit = False
  24. elif a is digit and not is_previous_digit:
  25. new_list.append('#')
  26. digit_count += 1
  27. is_previous_digit = True
  28. elif a is other and not is_previous_digit:
  29. new_list.append('@')
  30. other_count += 1
  31. is_previous_digit = False
  32.  
  33. print(letter_count)
  34. print(digit_count)
  35. print(other_count)
  36. print(new_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement