- Grand Theft Auto for the NES
- Auto Insurance : What is Auto Insurance?
- AAA Auto Insurance Quotes – How To Get The Cheapest Rates
- Keep auto insurance affordable!
- Buying Auto Insurance Online
- CURE Auto Insurance Ad
- Car Insurance
- Auto Insurance Advice : How to Find Good Auto Insurance
- Auto Insurance : What Is Full Coverage Automobile Insurance?
- Auto insurance companies now use your credit rating in adjusting your insurance rates
- Found a Great Auto Insurance Site With Free Quotes
- Auto/Car Insurance Coverage Laws Explained – New York State
- Pennsylvania Auto Insurance Quote – Better Coverage – Much Lower Prices
- It Must Be Eagle Man!
- Auto Insurance Guide for High Risk Drivers
- Geico auto insurance wood chuck (spoof)
- Auto Insurance : How Do Insurance Companies Define a Total Auto Loss?
- How SR22 Insurance Works
- (AAA Auto Insurance Quotes) Get *FREE* Instant Quotes Here
- Find Cheap Auto Insurance Quotes with a Car Insurance Quotes Website
- “Life comes at you fast!” in this funny insurance commercial that takes place in a bank.
- Nationwide “Safari” Auto Insurance Commercial
- Auto Insurance
- Seguro auto 101
- Cheap Auto Insurance | Auto Cheap Insurance | Auto Insurance @ www.autocheap-insurance.com
- “Door Dings” Commercial- 21st Century Auto Insurance: Same Great Coverage For Less
- Auto Insurance Tips
- HOW TO FIND CHEAP CAR INSURANCE (AUTO INSURANCE)
- De Kuiper van CNN 360 Anderson – AutoDeel 1 van de Verzekering
- TurboRater – auto insurance comparative rater
- Cars – Auto Insurance Quotes
- auto insurance ratings | best auto insurance ratings
- Low Cost Auto Insurance For Teens – Tips
A code to compute test scores?
by admin on Mar.26, 2010, under bio caddy
A code to compute test scores?
1.
def findLargest(L):
2.
largest = 0
3.
for x in L:
4.
if x > largest:
5.
largest = x
6.
return largest
7.
8.
def findSmallest(L):
9.
smallest = 300000000
10.
for x in L:
11.
if x < smallest:
12.
smallest = x
13.
return smallest
14.
15.
def findAverage(L):
16.
sum = 0.0
17.
for x in L:
18.
sum = sum + x
19.
return sum/len(L)
20.
21.
def findLetterGrade(score):
22.
#if (score >= 90) and (score <= 100):
23.
if score in range(90,101):
24.
return "A"
25.
elif score in range(80, 90):
26.
return "B"
27.
elif score in range(70, 80):
28.
return "C"
29.
elif score in range(60, 70):
30.
return "D"
31.
elif score in range(1, 60):
32.
return "F"
33.
34.
def countGrades(L):
35.
countA = 0
36.
countB = 0
37.
countC = 0
38.
countD = 0
39.
countF = 0
40.
for i in L:
41.
if findLetterGrade(score) == "A":
42.
countA = countA + 1
43.
elif findLetterGrade(i) == "B":
44.
countB = countB + 1
45.
elif findLetterGrade(i) == "C":
46.
countC = countC + 1
47.
elif findLetterGrade(i) == "D":
48.
countD = countD + 1
49.
elif findLetterGrade(i) == "F":
50.
countF = countF + 1
51.
return [countA,countB,countC,countD,countF]
52.
53.
def computeAnswers(L):
54.
largest = findLargest(L)
55.
smallest = findSmallest(L)
56.
average = findAverage(L)
57.
gradeCounts = countGrades(totalGrades(L))
58.
return [gradeCounts[0],gradeCounts[1],gradeCoun…
59.
gradeCounts[4],len(L),average,largest,sm…
60.
61.
###this is the part I need help with to make the output####
62.
def main():
63.
…
64.
…
65.
answers = computeAnswers(Scores)
66.
print
67.
print
def findLargest(L): largest = 0 for x in L: if x > largest: largest = x return largest def findSmallest(L): smallest = 300000000 for x in L: if x < smallest: smallest = x return smallest def findAverage(L): sum = 0.0 for x in L: sum = sum + x return sum/len(L) def findLetterGrade(score): #if (score >= 90) and (score <= 100): if score in range(90,101): return "A" elif score in range(80, 90): return "B" elif score in range(70, 80): return "C" elif score in range(60, 70): return "D" elif score in range(1, 60): return "F" def countGrades(L): countA = 0 countB = 0 countC = 0 countD = 0 countF = 0 for i in L: if findLetterGrade(score) == "A": countA = countA + 1 elif findLetterGrade(i) == "B": countB = countB + 1 elif findLetterGrade(i) == "C": countC = countC + 1 elif findLetterGrade(i) == "D": countD = countD + 1 elif findLetterGrade(i) == "F": countF = countF + 1 return [countA,countB,countC,countD,countF] def computeAnswers(L): largest = findLargest(L) smallest = findSmallest(L) average = findAverage(L) gradeCounts = countGrades(totalGrades(L)) return [gradeCounts[0],gradeCounts[1],gradeCoun… gradeCounts[4],len(L),average,largest,sm… ###this is the part I need help with to make the output#### def main(): … … answers = computeAnswers(Scores) print print
##The output is SUPPOSED to look like this.
#>>> from Scores import *
#>>> main()
#Enter score (0 to stop): 63
#Enter score (0 to stop): 75
#Enter score (0 to stop): 72
#Enter score (0 to stop): 72
#Enter score (0 to stop): 78
#Enter score (0 to stop): 67
#Enter score (0 to stop): 80
#Enter score (0 to stop): 63
#Enter score (0 to stop): 75
#Enter score (0 to stop): 90
#Enter score (0 to stop): 89
#Enter score (0 to stop): 43
#Enter score (0 to stop): 59
#Enter score (0 to stop): 99
#Enter score (0 to stop): 82
#Enter score (0 to stop): 12
#Enter score (0 to stop): 100
#Enter score (0 to stop): 0
#
#Number of "A" scores = 3
#Number of "B" scores = 3
#Number of "C" scores = 5
#Number of "D" scores = 3
#Number of "F" scores = 3
#————————-
#Total Scores = 17
#Average Score = 71.0
#Maximum Score = 100
#Minimum Score = 12




March 26th, 2010 on 2:22 am
I would reccomend using Microsoft Works Spreadsheet to average test scores. It is a free program that comes with the Windows Operating System.