Advertisement
bl00dt3ars

04. Sum Of A Beach

May 26th, 2021
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1. string = input()
  2. counter = 0
  3.  
  4. for el in range(len(string)):
  5.     if string[el] == "s" or string[el] == "S":
  6.         if string[el + 1] == "a" and el + 3 <= len(string) - 1 or string[el + 1] == "A" and el + 3 <= len(string) - 1:
  7.             if string[el + 2] == "n" or string[el + 2] == "N":
  8.                 if string[el + 3] == "d" or string[el + 3] == "D":
  9.                     counter += 1
  10.         elif string[el + 1] == "u" and el + 2 <= len(string) - 1 or string[el + 1] == "U" and el + 2 <= len(string) - 1:
  11.             if string[el + 2] == "n" or string[el + 2] == "N":
  12.                 counter += 1
  13.     elif string[el] == "w" and el + 4 <= len(string) - 1 or string[el] == "W" and el + 4 <= len(string) - 1:
  14.         if string[el + 1] == "a" or string[el + 1] == "A":
  15.             if string[el + 2] == "t" or string[el + 2] == "T":
  16.                 if string[el + 3] == "e" or string[el + 3] == "E":
  17.                     if string[el + 4] == "r" or string[el + 4] == "R":
  18.                         counter += 1
  19.     elif string[el] == "f" and el + 3 <= len(string) - 1 or string[el] == "F" and el + 3 <= len(string) - 1:
  20.         if string[el + 1] == "i" or string[el + 1] == "I":
  21.             if string[el + 2] == "s" or string[el + 2] == "S":
  22.                 if string[el + 3] == "h" or string[el + 3] == "H":
  23.                     counter += 1
  24.        
  25. print(counter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement