Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - import random
 - #mean function
 - def mean_func(values):
 - length = len(values)
 - total_values = 0
 - total_sum=sum(values)
 - average =total_sum/length
 - return average
 - scores = []
 - for x in range (0, 100):
 - scores.append(random.randint(0, 100)) #generate the list of scores
 - print(scores)
 - average_score = mean_func(scores)
 - print("The average score is",average_score,)
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment