Question

In: Computer Science

A bowling team consists of five players. Each player bowls three games. Write a program, in...

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.

Solutions

Expert Solution

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))
    

Related Solutions

Soma recorded in the table the height of each player on the basketball team Basketball Players’...
Soma recorded in the table the height of each player on the basketball team Basketball Players’ Heights (in inches) 66 66 68 57 64 65 67 67 64 65 Construct a normal probability distribution curve for this population! Indicate the number for the mean, 1SD, 2SD and 3SD (both sides of the mea) (1+ 6*0.5=4p)
**Program needs to be in matlab format** A bowling match consists of ten frames. Each frame...
**Program needs to be in matlab format** A bowling match consists of ten frames. Each frame except for the tenth consists of one or two balls, or attempts to knock down the ten pins at the end of the alley. Doing so on the first ball of the frame is called a strike, and the second ball of the frame is not rolled. Knocking down all ten pins with both balls (having left some up with the first ball) is...
Write a program in C++ to keep statistics for a basketball team consisting of 10 players...
Write a program in C++ to keep statistics for a basketball team consisting of 10 players using parallel arrays. The stats for each player should include the total points, shots attempted, shots made, free throw attempts, free throws made, rebounds, assists, and turnovers. Use functions to perform the following: Calculate the shooting percentage Calculate free throw percentage Print the player's names, shooting percentage, free throw percentage, rebounds, assists, and turnovers. After each player, use "endl" to skip to a new...
Tony Gaddis C++ Tic-Tac-Toe Write a program that allows two players (player X and player O)...
Tony Gaddis C++ Tic-Tac-Toe Write a program that allows two players (player X and player O) to play a game of tic-tac-toe. Use a two- dimensional char array with three rows and three columns as the game board. Each element of the array should be initialized with an asterisk (*). The players take turns making moves and the program keeps track of whose turn it is. Player X moves first. The program should run a loop that: Displays the contents...
16#2 The following table provides the starting players of a basketball team and their heights Player...
16#2 The following table provides the starting players of a basketball team and their heights Player A B C D E Height (in.) 75 77 78 81 84 a. The population mean height of the five players is: 79 b. Find the sample means for samples of size 2. A, B: ?¯ = A, C: ?¯ = A, D: ?¯ = A, E: ?¯= B, C: ?¯ = B, D: ?¯ = B, E: ?¯ = C, D: ?¯= C,...
Consider the following game that has two players. Player A has three actions, and player B...
Consider the following game that has two players. Player A has three actions, and player B has three actions. Player A can either play Top, Middle or Bottom, whereas player B can play Left, Middle or Right. The payoffs are shown in the following matrix. Notice that a payoff to player A has been omitted (denoted by x). Player B    Left Middle Right Top (-1,1) (0,3) (1,10) Middle (2,0) (-2,-2) (-1,-1) Bottom (x,-1) (1,2) (3,2) (player A) Both players...
Suppose three players go on multiple rounds of kart race. In each round, every player has...
Suppose three players go on multiple rounds of kart race. In each round, every player has a winning probability of 1/3, independent of other rounds. let N denote the number of rounds until player 1 has two consecutive wins. Find a.) Find P (N ≤ 10). (2 points) b.) Find P (N = 10). (2 points)
Three players toss coins simultaneously. For each player, P (H) = p, P (T) = q....
Three players toss coins simultaneously. For each player, P (H) = p, P (T) = q. If the result is 2H and 1T or the result is 2T and 1H, then the player that is different from the other two is called the odd man out and the game is over. If the result is 3H or 3T, then the players toss again until they get an odd man out. Find the probability that the game lasts at least 6...
Suppose three players go on multiple rounds of kart race. In each round, every player has...
Suppose three players go on multiple rounds of kart race. In each round, every player has a winning probability of 1/3, independent of other rounds. Let N denote the number of rounds until player 1 has two consecutive wins. a) Find P(N <= 10) b) Find P(N = 10)
Two players (player A and player B) are playing a game against each other repeatedly until...
Two players (player A and player B) are playing a game against each other repeatedly until one is bankrupt. When a player wins a game they take $1 from the other player. All plays of the game are independent and identical. Suppose player A starts with $6 and player B starts with $6. If player A wins a game with probability 0.5, what is the probability the game ends (someone loses all their money) on exactly the 10th play of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT