infilename = input("Enter the name of the file:") infile = open ( infilename ,'r') for line in infile: line = line.split()