#!/usr/bin/env python s = raw_input("Enter a line: ") print "The number of words in the line are %d" % (len(s.split(" ")))
[kd@kdlappy book]$ ./countwords.py Enter a line: Sayamindu is a great programmer The number of words in the line are 5