1
1
def get_score():
scores = []
import random
for i in range(10):
scores.append(random.randint(100, 300))
return scores
player_score = get_score()
#calculate average score:
total=0
for score in player_score:
total=total+score
average=total/10
#calculate highest score:
def highest_score():
highest_score=player_score[0]
for score1 in player_score:
if score1>player_score:
highest_score=score1
return highest_score
#calculate lowest score:
def lowest_score():
lowest_score=player_score[0]
for score2 in player_score:
if score2<player_score:
lowest_score=score2
return lowest_score
print"-----------------------Statistics for each player------------------------"
print "Player: 1"
print "Score (10 games): " + str(player_score)
print "Average Score: " + str(average)
print "Highest Score:" + str(highest_score)
print "Lowest Score:" + str(lowest_score)