Please help with PYTHON exercise 1 below: Write a program Sores.py to process a
ID: 3773908 • Letter: P
Question
Please help with PYTHON exercise 1 below:
Write a program Sores.py to process a student's homework scores. Ask user to enter the homework scores for a student and save the scores in a list. Loop through the list to find the total score and the lowest score. (Do not use built-in function, sum and min. You need to write a loop to process the scores). Calculate the raw average score and modified average score (after dropping the lowest score). Print out the raw average score and the modified average score. Sample output: Enter homework scores separated by spaces: 90 80 85 87 78 61 95 90 Raw average: 83.25 Modified average after dropping lowest score: 86.43 Define a class FrequentFlyer in FrequentFlyer.py that has the following: Two data fields: flyerName(String), milesBalance (integer) A constructor that creates a flyer with the specified name and miles flown. Standard methods: getName, setName, getMiles, setMiles Additional methods: getStatus method to determine the membership status based on the miles balance,Explanation / Answer
print ("Enter the homework scores separated by spaces : ");
numbers = [int(n) for n in input().split(" ")]
print (numbers)
sum = 0.0;
small = numbers[0];
for i in range(len(numbers)):
sum += numbers[i]
if numbers[i]<small:
small = numbers[i];
print ("Raw average: ",round(sum/len(numbers),2))
print ("Modified average after dropping lowest score : ",round((sum-small)/(len(numbers)-1),2))
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.