1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lostsunrise [7]
4 years ago
15

Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds o

f 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).
Computers and Technology
2 answers:
inna [77]4 years ago
6 0

Answer:

filepath = 'Iliad.txt'

start = 'sometxtstart'

end = 'sometxtend'

apending = False

out = ""

with open(filepath) as fp:

   line = fp.readline()

   while line:

       txt = line.strip()

       if(txt == end):

           apending = False

       if(apending):

           out+=txt + '\n'

       if(txt == start):

           apending = True                

       line = fp.readline()

print(out)

xenn [34]4 years ago
3 0

Answer:

def func(filename, lower, upper):

   file = open(filename, 'r').readlines()

   for i in range(int(lower), int(upper)):

       print(file[i].rstrip())

func('strings','2','4')

Explanation:

file is provided below, name: strings in text format

appleelppa

banananana

cattaccatt

dogdogdogd

elephanttn

froggorffr

goattaoggo

horseesroh

illiterate

jumppmujju

You might be interested in
How many invalid code sequences can we have in 5b/6b encoding?
mart [117]
<span>In the process of 5B/6B encoding, it is possible to have the following two kinds of data sequences: 1. 25=32 data sequences 2. 26=64 data sequences Therefore, this can left us with some unused code sequences that are 32 in number (=26 – 25). On the other hand, in the encoding process of 3B/4B, it is possible to another set of data sequences as follows: 1. 23=8 data sequences 2. 24=16 data sequences This type of encoding also leaves us with some unused code sequences that are 8 in number (=23-24). 2. </span>
6 0
3 years ago
What is the purpose of an IP address? A. identifying source and destination of data B. creating images on websites C. drawing ta
natka813 [3]

Answer:

The Answer is A. I could be wrong though.

3 0
3 years ago
Read 2 more answers
The objective is to work with your partner to fix the HTML bugs so that none of the code is pink. In general, how do I change HT
Elan Coil [88]

Answer:

Click inspect then go to change color

Explanation:

there you go have a nice day!

8 0
3 years ago
Explain mportance of using Microsoft Excel in pharmaceutical science​
goldenfox [79]

Answer:

research the question and go to setting and press advanced search and it will give answer

4 0
3 years ago
Write a statement that assigns cell_count with cell_count multiplied by 10. * performs multiplication. If the input is 10, the o
Pavlova-9 [17]

Answer:

The complete program is:

cell_count = int(input())

cell_count = cell_count * 10

print(cell_count)

Explanation:

This line gets input for cell_count

cell_count = int(input())

This line multiplies cell_count by 10

cell_count = cell_count * 10

This prints the updated value of cell_count

print(cell_count)

5 0
3 years ago
Other questions:
  • What are the advantages of renting a home over buying a home? What are some disadvantages?
    13·1 answer
  • friend wanted us to decode this message ----- .---- ----- ----- .---- ----- ----- .---- / ----- .---- .---- .---- ----- .---- .-
    11·1 answer
  • The commands available from a menu change depending upon what you are doing.<br> True<br> False
    11·2 answers
  • A junior network administrator tells you that he can ping a DNS server successfully using its IP address, but he has not tested
    11·1 answer
  • Two ways in which the media does not reflect the society you live in.
    9·1 answer
  • Which of the following You tubers uses the word "flip" as a curse word
    8·2 answers
  • What is multimedia computer system​
    7·1 answer
  • Please help I really don't understand much about web technology.
    8·1 answer
  • Trebuie sa scrii niște instrucțiuni în JavaScript care adaugă în DIV lungimea HTML-ului din interiorul tag-ului cu ID​
    14·1 answer
  • I want know answer for best way to copy formula on MS Access
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!