Answer:
def insSort(arr):
ct=0;
for i in range(1, len(arr)):
key = arr[i]
j = i-1
while j >=0 and key < arr[j] :
arr[j+1] = arr[j]
j -= 1
ct=ct+1;
arr[j+1] = key
return arr,ct;
print(insSort([2,1]))
Output of the program is also attached.
This is how you know i’m def gonna fail my university class this year :/
Answer:
In Python:
import os.path
from os import path
fname = input("Filename: ")
if path.exists(fname):
with open(fname) as file_in:
lines = []
for line in file_in:
lines.append(line.rstrip('\n'))
f = open("stat.txt","r+")
f.truncate(0)
f = open("stat.txt", "a")
f.write("Names\tTotal\tSubjects\tAverage\n")
for i in range(len(lines)):
rowsum = 0; count = 0
nm = lines[i].split()
for j in nm:
if (j.isdecimal()):
count+=1
rowsum+=int(j)
average = rowsum/count
f.write(nm[0]+"\t %3d\t %2d\t\t %.2f\n" % (rowsum, count, average))
f.close()
else:
print("File does not exist")
Explanation:
See attachment for explanation where comments were used to explain each line
Answer:
The correct answer is option (D).
Explanation:
According to the scenario, the most appropriate answer is option (D) because the firewall can be defined as the software program which checks through the network for incoming and outgoing communication on predefined rules.
while the other options are wrong because of the following reasons :
- A sniffer can be defined as the program which is used to check the network traffic but it didn't work on predefined rules.
- An auditor can be defined as a program that is used to analyze the network.
- The hacker can be a person who hacks the system to gain access or gather information.
In the case above, the cell that you can highlight before selecting freeze panes is row 3 column 4.
<h3>How do one freeze several column?</h3>
This can be done when a person select the column that's is said to be next to the right of the last column a person want to freeze.
Therefore, In the case above, the cell that you can highlight before selecting freeze panes is row 3 column 4.
Learn more about panes from
brainly.com/question/17194167
#SPJ1