Advertisement
cd62131

count char

Dec 1st, 2018
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import sys
  3. def count_char():
  4.     if not input().startswith('a'):
  5.         return 0
  6.     c = 0
  7.     for s in sys.stdin:
  8.         size = len(s.rstrip('\n'))
  9.         if size == 0:
  10.             return c
  11.         c += size
  12.     return c
  13.  
  14. print(count_char())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement