SaveText.Ru

Без имени
  1. f = open('24-j5.txt', 'r')
  2. txt = f.read()
  3. f.close()
  4.  
  5. k = 0
  6. for x in range(len(txt)-5):
  7.     if txt[x:x+5] != "STOCK" and txt[x+2:x+5]=="OCK":
  8.         k+=1
  9. print(k)

Share with your friends:

Print