1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kakasveta [241]
3 years ago
13

You have been given the following String which represents a series of 6 side die rolls:rolls = "1,5,2,3,5,4,4,3,1,1,1,2,3,1,5,6,

2"Write a program that analyzes the rolls and computes the following:
i. The total # of rolls.
ii. The sum of all the rolls (1+2+3…)
iii. The average value of the rolls.

Here is a sample output of your program:Total # of rolls: 17Total value of all rolls: 49Average roll: 2.88235P art 2 – Can you extend your code such that the string (for the series of die rolls) is a user input?

Computers and Technology
1 answer:
Anni [7]3 years ago
8 0

Answer:

see explaination

Explanation:

rolls="1,5,2,3,5,4,4,3,1,1,1,2,3,1,5,6,2"

list1 = list(rolls.split(","))

print("The total # of rolls: {}".format(len(list1)))

j=0

for i in list1:

j+=int(i)

print("Total value of all rolls: {}".format(j))

print("Average roll: {}".format(j/len(list1)))

Please kindly check attachment for program code and output

You might be interested in
You are designing an exciting new adventure game and you want to attempt to explain where items that are carried by the player a
alukav5142 [94]

Answer:

hYou are designing an exciting new adventure game and you want to attempt to explain where items that are carried by the player are being kept. What inventory system should you use to this? O visual grid approach hyperspace arsenal weighted inventory pseudo-realistic​

Explanation:

6 0
2 years ago
A computer has a pipeline with four stages. Each stage takes the same time to do its
g100num [7]

3ns (for first instruction to go down the pipeline).

10^9 ns per second. 10^9 – 3 = 999999997 instructions.

3 0
2 years ago
Enter the value of 5⋅(13.5−4.5). <br> ​
blsea [12.9K]

Answer and Explanation:

Greetings!

Let's~answer~your~question!

For~this~question,~we~do~parenthesis~first:

13.5-4.5=9

Then,~we~multiply~them~together:

9\times5=45

Thus,~the~answer~to~your~question~is~45.

Hope~my~answer~helps~and~have~a~blessed~day~ahead!

-Isabelle~Williams

8 0
3 years ago
the increase and decrease font button and the change text colour button (as shown in the picture )are include in which group ?​
denpristay [2]

Answer:

These are the part of FONT Group on MS word / Excel application where you can increase and decrease font, change text color, highlight text, select font from the list and many other functions.

You can also perform advance functions related to Font by clicking on a small arrow like icon in bottom right corner.

5 0
2 years ago
How to convert meters to centimeters in c programming​
mote1985 [20]

Answer:

Input

Enter length in centimeter = 1000

Output

Length in meter = 10 m

Length in kilometer = 0.01 km

Explanation:

hope this helps

5 0
3 years ago
Other questions:
  • Which cloud computing service model gives software developers access to multiple operating systems for testing?
    5·1 answer
  • HELPPP ASAPP
    8·2 answers
  • Change control in application development is a formal process for changing written documentation into online documentation, and
    13·1 answer
  • What are the problems with security when working on a Web Page?
    13·2 answers
  • Microsoft has developed the Active Directory Domain structure so that a central authority, called the __________, is the reposit
    7·1 answer
  • What do computer programs generally try to solve and how? A) Computer programs generally try to solve a well-defined problem usi
    14·1 answer
  • A recursive method that computes the number of groups of k out of n things has the precondition that ______. n is a positive num
    12·1 answer
  • Identify the correct answer in each item. Write your answer on the blank provided before
    13·1 answer
  • How are the waterfall and agile methods of software development similar?
    13·1 answer
  • Define foreign employment​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!