def update_counts(s, counts):
 for char in s:
  if (char in counts):
   counts[char] += 1

def update_counts ( s , counts ) : for char in s : if ( char in counts ) : counts [ char ] += 1
adds one to the counts of each appearance of characters in s .