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:
SELECT paintname, COUNT(paintname) as count_paintname
FROM paint
GROUP BY paintname HAVING COUNT(paintname) > 2
ORDER BY paintname
Explanation:
The structured query language or SQL statement returns two columns of paintname and the count of the distinct paint names in the paint table with rows of grouped paint names greater than two and in the ascending order of the names.
1. If in MS Access, Click on Query design, select the required Table.
In Field select required field, in this case Select [Name of Plants]. Click on Order and set it as Ascending / Descending.
2. If you want to write a Query that it will look like this
SELECT MedicinalPlants.Name of the plantsFROM MedicinalPlantsORDER BY MedicinalPlants.Name of the Plants;
Read more on Brainly.com - brainly.com/question/3433328#readmore
According to Newton's third law, for every action force there is an equal (in size) and opposite (in direction) reaction force.