Advertisement
Joporezka1

Untitled

Mar 10th, 2021
697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. f = open('24.txt')
  2. l = [line.strip() for line in f]
  3. gcnt=0
  4.  
  5. for i in range(len(l)):
  6.     s = l[i]
  7.     cntA =0
  8.     cntE=0
  9.     for j in range(len(s)):
  10.         if s[j]=='A':
  11.             cntA+=1
  12.         elif s[j]=='E':
  13.             cntE+=1
  14.     if cntA>cntE:
  15.         gcnt+=1
  16. print(gcnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement