s = "Count, the number of spaces." print s.count(" ") x = "I like to program in Python" print x.count("i")