|
|
вернуться в форумAC My program (with error, I know where it is, but I will not write about it): import sys text = sys.stdin.readlines() text = ''.join(text) for symbol in ',;:-\n': text = text.replace(symbol, ' ') text = text.replace('!', '.').replace('?', '.') import re text = ' '.join(text.split()) text = text.replace('. ', '.') text = '.'.join(text.split('.')) text = text.replace(' .', '.') count = 0 for sentence in text.split('.'): if sentence != '': if sentence[0].islower(): count += 1 for word in sentence.split(): for letter in word[1:]: if letter.isupper(): count += 1 print(count) Edited by author 06.07.2016 19:17 |
|
|