54,620 views
16 votes
16 votes
9.19 LAB: Words in a range (lists) Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds of a search range. The file should be read using the file.readlines() method. The input file contains a list of alphabetical, ten-letter strings, each on a separate line. Your program should output all strings from the list that are within that range (inclusive of the bounds). Ex: If the input is:

User Lashonda
by
2.6k points

2 Answers

9 votes
9 votes

Final answer:

The question asks for a program to read ten-letter strings from a file and output those within a specified range using the file.readlines() method.

Step-by-step explanation:

The question pertains to writing a computer program that involves reading from a file and outputting certain strings that fall within a specified range. In addressing this question, you would write a program that prompts the user to enter the name of an input file and two strings that define the lower and upper bounds of the range.

The program then reads ten-letter alphabetical strings from the file and outputs those which are within the user-defined range. The file.readlines() method is used to read the file, and the program should be inclusive of the bounds when determining if a string is within the specified range.

User Suraj Bahl
by
3.3k points
23 votes
23 votes

Answer:

9.2. Métodos del Objeto File (Python para principiantes)

Step-by-step explanation:

User Yohannist
by
2.4k points