Advertisement
MagicWinnie

Untitled

Feb 3rd, 2022
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. #9.57
  2. s = input()
  3.  
  4. for i in range(len(s)):
  5.     if s[i] == 'и' and i % 2 == 0:
  6.         print(s[i])
  7.  
  8. #9.58
  9. s = input()
  10.  
  11. for i in range(0, len(s) - 1, 4):
  12.     print(s[i])
  13.     print(s[i + 1])
  14.  
  15. #9.59
  16. s = input()
  17.  
  18. result = 0
  19. for i in range(len(s)):
  20.     if s[i] == 'о':
  21.         result += 1
  22.  
  23. print(result)
  24.  
  25. #9.60
  26. s = input()
  27.  
  28. result = 0
  29. for i in range(len(s)):
  30.     if s[i] == ' ':
  31.         result += 1
  32.  
  33. print(result)
  34.  
  35. #9.61
  36. s = input()
  37. c = input()
  38.  
  39. result = 0
  40. for i in range(len(s)):
  41.     if s[i] == c:
  42.         result += 1
  43.  
  44. print(result)
  45.  
  46. #9.62
  47. s = input()
  48.  
  49. result = 0
  50. for i in range(len(s)):
  51.     if s[i] == 'а':
  52.         result += 1
  53.  
  54. print(result / len(s) * 100, '%')
  55.  
  56. #9.63
  57. s = input()
  58.  
  59. result1 = 0
  60. result2 = 0
  61. for i in range(len(s)):
  62.     if s[i] == '+':
  63.         result1 += 1
  64.     if s[i] == '*':
  65.         result2 += 1
  66.  
  67. print('+:', result1)
  68. print('*:', result2)
  69.  
  70. #9.64
  71. s = input()
  72.  
  73. result = 0
  74. for i in range(len(s) - 1):
  75.     if s[i] == s[i + 1]:
  76.         result += 1
  77.  
  78. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement