python count how many lines a character shows up in a play code example Example: count a newline in string python length = x.count('\n')