Python Code:
import math
# this function calculates the mean of the list l
def calc_mean(l):
return sum(l)/len(l)
# this function calculates the stadard deviation of the list
l
def calc_stdDev(l):
m = sum(l)/len(l) # mean
n = len(l) # number of elements in the list
temp = 0
# calculate sum of squared diff. from mean
for i in l:
temp+=(i-m)**2
return math.sqrt(temp/n)
# this function calculates the grade of the student depending on
the exam score, mean and stdDev
def assign_grade(EX,m,s):
if EX >= (m+1.5*s):
return 'A'
elif EX >= (m+0.5*s) and EX < (m+1.5*s):
return 'B'
elif EX >= (m-0.5*s) and EX < (m+0.5*s):
return 'C'
elif EX >= (m-1.5*s) and EX < (m-0.5*s):
return 'D'
elif EX < (m-1.5*s):
return 'F'
# main function
def main():
file_object = open('Scores.txt') # open the file
# the elements in the text file are exam scores of
students, one score per line
list_of_scores = []
num_of_scores = 0
for item in file_object.readlines():
exam_score =
int(item.split('\n')[0])
list_of_scores.append(exam_score)
num_of_scores+=1
m = calc_mean(list_of_scores) # mean
s = calc_stdDev(list_of_scores) # standard
deviation
# print the mean and standard deviation
print("Number of scores: "+str(num_of_scores))
print("Average of scores: "+str(m))
print("Standard Deviation of scores: "+str(s))
# print out the grade of the students
for i in range(num_of_scores):
grade =
assign_grade(list_of_scores[i],m,s)
print("Exam score:
"+str(list_of_scores[i])+", Grade:"+grade)
if __name__ == '__main__':
main()
Code Snapshot:
Output:
Write a Python Program Preview File Edit View Go Tools Window OO 95% Help An Intro...
Preview File Edit View Go Tools Window Help Ch6 normal distribution_Jab.pdt (page 1 of 2)-Edited Ch8 normal,distribution Jab.pdf (page 1 of 2) The Normal Distribution: Normal Distribution Lab Collect the Data: Measure the length of your pinkie finger (in cm.) Record the lengths of the entire class below. Round to the nearest 0.5 cm 2.5 5.5 6.5 6.5 6.5 6.5 6.5 6.5 2.5 5.5 5.5 5.5 7.5 4.5 6.5 6.5 6.5 6.5 Construct a histogram. Make S -6 nteralk sketch...
View Go Tools Window Help Edit File Preview Unit 2 Exam Review PPT 1 (2).ppt (page 18 of 24) Q Search 17. There no antidote for succinylcholine. A. True B.False
View Go Tools Window Help Edit Preview File Exam Review PPT 1.(2) .ppt (page 5 of 24) Unit 2 Q Search 4. Maj divisions of the peripheral nervous system include: A. parasympathetic and sympathetic B. somatic and autonomic C. brain and spinal cord A: 1 Medication- Digoxin # Classification The... See answer frome 4le
Preview File Edit View Go Tools Window Help Homework_6.pdf (1 page) Homework_5.pdf pagal 2. An array of n distinct integers is to be searched using Sequential Search. The probability that the search key matches the last item in the array is y, and the probability that the item searched for is not present in the array is likewise y. The probabilities of matching the 19through (n-1)"items are all equal. What is the average case time complexity, A(n), where the basic...
Window Help Preview Edit View Go Tools File Review PPT 1.(2).ppt (page 20 of 24) Unit 2 Exam Q Search 19. The xathine drug class has a therapeutic index requiring blood levels to be monitored. A. narrow B.broad/wide
Please include detailed explenation. Thank you Preview File Edit View Go Tools Window Help review warmup Nov14.pdf (1 page) Q Search Name: Student Number: 4 pts We consider the energy + 3, where ni 2 1,n2 2 1, and ns e 1. (1) Find (n,, n2, n3) for the ground state. (2) Find (n,, n2, n3) for the first excited state. Bonus quiz: 3pts lustrate and explain a spherical coordinate system.
Window Help Tools Go View Edit File Preview Unit 2 Exam Review PPT 1(2).ppt (page 10 of 24) Q Search 9. A side ffect of ipratropium bromide Atrovent®) is that it dries the mucous membranes. Α. True B.False A: 1 Medication- Digoxin # Classification The.. See answer of
Tools Window Help Go View Edit File Preview Unit 2 Exam Review PPT 1.(2)-ppt (page 19 of 24) Q Search 18. Functions of the respiratory system inc ude: A. gas exchange B.bringing 02 into the cells C. carrying CO2 out of the body D. all of the above Add an account
View Go Tools Window Help Edit Preview File Unit 2 Exam Review PPT 1 (2).ppt (page 4 of 24) Q Search C 3, Regarding the preganglionic neuron, ACH is re eased in both the sympathetic and paras mpathetic nervous systems. Α. True B.False A: 1 Medication- Digoxin # Classification The... See answer Q: from these informations. can i please be helped with. 1 2 pharmacological treatmont T non-nharmace
View Go Tools Window Help Edit File Preview Unit 2 Exam Review PPT 1.(2).ppt (page 15 of 24) Q Search 14. Beta-1 drenergic blockers have which of the following effects: A. positive inotropic B. positive chronotropic C. negative inotropic D. negative chronotropic E.both c and d are correct Add an account