# CSE 142, Summer 2008 (Kimberly Todd) # This program shows movies that match a given search phrase # from an IMDb input file with lines in the following format: # # 1 9.1 243153 The Godfather (1972) search_word = raw_input("Search word? ") matches = 0 file = open("imdb.txt") for line in file: tokens = line.split() rank = int(tokens[0]) rating = float(tokens[1]) votes = int(tokens[2]) title = " ".join(tokens[3:]) # does title contain searchWord? if search_word.lower() in title.lower(): matches += 1 print rank, "\t", votes, "\t", rating, "\t", title print matches, "matches."