Guest User

Untitled

a guest
Oct 17th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. def checkio(line):
  2.     'Calculate amount of words which contain exactly two "o" letters'
  3.     result = 0
  4.     alist = line.split()
  5.  
  6.     for words in alist:
  7.         if 'oo' in words:
  8.             result += 1
  9.  
  10.     return result
  11.  
  12. if __name__ == '__main__':
  13.     assert checkio('voodo google soon color job') == 3, 'First'
  14.     print('All ok')
  15.  
  16.  
  17. #By ephexeve.blogspot.com
Add Comment
Please, Sign In to add comment