In: Computer Science
A bowling team consists of five players. Each player bowls three games. Write a program, in python, that uses a nested loop to enter each player’s name and individual scores (for three games). You will use one variable for the name and only one variable to enter the scores. Do not use score1, score2, and score3. Compute and display the bowler’s name and average score. Also, calculate and display the average team score.
YOU MUST USE A NESTED LOOP FOR CREDIT.
COde and output
Code for copying
list1=[]
list2=[]
for i in range(1,6):
n=str(input("Enter playes name: "))
m=list(map(float,input("Enter the scores:
").rstrip().split()))
avg=sum(m)/3
list1.append(n)
list2.append(avg)
for i in range(0,5):
print("{}-{}".format(list1[i],list2[i]))
print("The average score is {}".format(sum(list2)/5))
Code snippet
list1=[]
list2=[]
for i in range(1,6):
n=str(input("Enter playes name: "))
m=list(map(float,input("Enter the scores: ").rstrip().split()))
avg=sum(m)/3
list1.append(n)
list2.append(avg)
for i in range(0,5):
print("{}-{}".format(list1[i],list2[i]))
print("The average score is {}".format(sum(list2)/5))