# Program to print words in a line # NOTE: a "word" is any sequence of non-blank characters # (user enters line) # Matt Bishop, Apr. 24, 2009 # for ECS 10 Spring 2009 import string; # Break line into words and print the words one per line # parameter: line, the line to be split up def getwords(line): # create a list of words listwords = string.split(line, " "); # print them out one per line for i in listwords: print i # read a line, break it into words, and print the words # calls: function getwords def main(): # get line from user line = raw_input("Type your line: "); # break it into words and print them out getwords(line); main();