Answer:
The function in Python is as follows:
def search_file(filename,mystring):
my_dict = {}
count = 0
file = open(filename)
lines = file.readlines()
for line in lines:
count+=1
if mystring.lower() in line.lower():
my_dict[count] = line.rstrip('\n')
return my_dict
Explanation:
This defines the function
def search_file(filename,mystring):
This initializes an empty dictionary
my_dict = {}
This initializes the number of lines to 0
count = 0
This opens the file
file = open(filename)
This reads the lines of the file
lines = file.readlines()
This iterates through the lines
for line in lines:
This increments the number line
count+=1
This checks if the string exists in the line
if mystring.lower() in line.lower():
If yes, the line number and the string are added to the dictionary
my_dict[count] = line.rstrip('\n')
This returns the dictionary
return my_dict
The symbol that we do use to assign a value to a variable or constant in algorithms is =.
<h3>What is used to assign a constant to a variable?</h3>
The const keyword is known to be one that tends to specifies a variable or object value that is known to be constant.
In computing and computer programming, there are different kinds of variables as well as symbols that are used for different purposes.
Note that if you assign a variable, you need to use the = symbol and thus The symbol that we do use to assign a value to a variable or constant in algorithms is =.
Learn more about algorithms from
brainly.com/question/13800096
#SPJ1
Answer:
Round trip times required = log2N
Explanation:
The round-trip times required before TCP can send N segments using a slow start is log2N. we can arrive at this by looking at the mode of operation of TCP which is at the 1st time of using a TCP it starts the congestion window as 1 then it sends an initial segment. When the acknowledgement of the initial segment arrives, TCP increases the congestion window to 2 and then sends 2 segments, When the 2 acknowledgements of the segments sent out arrives, they each increase the congestion window by one, thereby increasing the congestion window to 4 . therefore it takes log2N round trips before TCP can send N segments
Answer:
RAM
Explanation:
"RAM" refers to <em>Random-Access Memory. </em>Just like the human brain, this stores your computer files temporarily. It is considered to be a <em>"volatile memory"</em> which means that information can only be stored<u> when there's power.</u> So, when your computer shuts down,<u> the information is los</u>t. This is similar to the human brain, especially when it comes to learning. When a person learns new things, some of the information he read before may be forgotten.
Answer:
The answer to this question is "information services and support and network system administration".
Explanation:
The information support and service and network system administration is used to outside work, which can be explained as follows:
- The information support and service process is using information processing that is defined as the system for record-keeping, forms, figures and data in a business.
- A network or device system administrators are responsible for the day-to-day deployment of all these networks. They arrange, restore, and promote the computer systems of the company, which include local area networks, WANs, system sections, web services, and other wireless communication systems. The system provides local area networks.