Feb-08-2019, 03:38 AM
(This post was last modified: Feb-08-2019, 03:45 AM by ichabod801.)
#This is the code i am trying to write
#its you're beginner "average test score" programming exercise
#how do i make a module that'll get the average , return the average and print the average?
#please help, thx
#its you're beginner "average test score" programming exercise
#how do i make a module that'll get the average , return the average and print the average?
#please help, thx
def main(): endProgram, totalScores, counter, scores, averageScore, number = declaredVariables() while endProgram == "no": endProgram, totalScores, counter, scores, averageScore, number = declaredVariables() number = getNumber() totalScores = getScores(counter, scores, number, totalScores) def declaredVariables(): endProgram = "no" totalScores = 0.0 counter = 0 scores = 0.0 averageScores = 0.0 number = 0 return endProgram, totalScores, counter, scores, averageScores, number def getNumber(): number = input("How many students took the test: ") return number def getScores(counter, scores, number, toalScores): for counter in range(0, 100): Scores = input("Enter score for the students: ") totalScores = totalScores + scores return totalScores main()