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
Which of these statements is true about database reports? A. A generated report will include all records in the database. B. A g
weeeeeb [17]

B. A generated report will include all records that a query fetches.

6 0
3 years ago
How many basic elements of QBASIC are there
Masteriza [31]
<h2>6</h2>

The elements used in Qbasic:

  • Character set.
  • Variables.
  • Constants.
  • Operator and Operands.
  • Expression.
  • Statements.
6 0
3 years ago
Under which command group will you find the options to configure Outlook rules?
stiks02 [169]

Answer:

Move

Explanation:

I hope that helps :)

4 0
3 years ago
Read 2 more answers
When i add someone to canvas course, do they get an invitation?.
stira [4]
<h2>Read</h2>

Explanation:

Canvas generates a course invitation when an enrollment is manually added to the course. (Find that in goggle)

Knew that I'm just bad at explaining lol

5 0
2 years ago
What should you follow when creating a newsletter ?
kenny6666 [7]
You should follow a set of directions

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which presentation software element can you use to create a model diagram with two concentric circles inside a triangle?
    10·2 answers
  • What is the typical relationship between time and interest rate?
    12·1 answer
  • Chandra, a student working on a group project, is trying to decide how to have the whole group suggest revisions for an essay. S
    10·1 answer
  • One study found that nearly ____________ of the 1600 college freshmen surveyed had sent sexually suggestive texts or photos.
    11·1 answer
  • Which word processing file that contains text and other
    13·2 answers
  • Directory servers from different vendors are synchronized through ________.
    9·1 answer
  • Which command button contains the following sub options as given in the picture?
    6·2 answers
  • What sorts of changes have you been observing in your society in your society in comparison in last 3 years​
    13·1 answer
  • What is a sensitive compartmented information program
    12·1 answer
  • Which is NOT true?<br> 9 + 4 = 17 - 4<br> 8 + 7 = 14 + 3<br> 11 = 19 - 8<br> 5 + 8 = 20 - 7
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!