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
The CPI is a measure of the overall cost of the goods and services bought by a. a typical consumer, and the CPI is computed and
Akimi4 [234]

Answer:

a typical consumer, and the CPI is computed and reported by the Bureau of Labor Statistics.

Explanation:

The CPI is a measure of the overall cost of the goods and services bought by a typical consumer , and the CPI is computed and reported by the Bureau of labor statistics. Hence, option C is correct.

5 0
3 years ago
Hola, alguien me puede ayudar¡¡¡¡¡¡¡¡¡¡¡¡
WARRIOR [948]
Hola<span>, </span>Alguien me<span> podría </span>ayudar<span> a realizar una buena sinopsis de la película "</span><span>Jardín de Amapolas" dirigida por Carlos Melo Guevara, gracias? i hope i helped you</span>
4 0
3 years ago
3.<br>What is the meaning of *.VBP.<br>​
Kisachek [45]

Answer:

The meaning of VBP is Visual Basic Project

7 0
3 years ago
Read 2 more answers
Explain three reasons why so many different computer languages exist.<br> Pleaseeee
zmey [24]

Each language has its own use, some of them are used to create or manipulate back end codes and some of them are used mainly for web designing and some of them are used for data entries and control of data that is being implanted in the system, so if you put all uses in one language it will not be a simple task as it is nowadays for programmers. That is why there are different compt. langs.

3 0
3 years ago
Some designer suggest that speech recognition should be used in tale phone menu system. This will allow users to interact with t
Sergio [31]

Answer:

My two arguments against the proposal are based on physical side effects and background noise interference.

Explanation:

To start with physical side effects, the use of speech recognition technology might make users experience physical discomfort. This is due to the fact that users who interact with the system by speaking for a long period would experience dry mouth, temporary loss of voice, vocal problems and muscle fatigue. In addition, the fact that users would always speak in an unnatural way to make the system interpret commands effectively could lead to voice strain.  

Also, users need to be in a quiet environment before they can get the best out of speech recognition technology. This is because background noise can interfere with commands and create a mix-up which the system cannot interpret. In other words, when an environment is noisy, speech recognition technology would find it difficult to differentiate between users voice and background noise.

4 0
3 years ago
Other questions:
  • While a computer is running the operating system remains in memory. true or false?
    7·1 answer
  • Your boss in the human resources department asks you to write a function that calculates the length of time that employees have
    6·1 answer
  • If you think a query is misspelled, which of the following should you do?
    15·1 answer
  • What are the pros and cons of editorial anonymity in Wikipedia
    10·2 answers
  • Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with e
    11·1 answer
  • Claire is trying to listen to her history professor's lecture, but her mind keeps wandering to thoughts about her plans for the
    5·1 answer
  • Combining two or more cells to make one is called​
    8·1 answer
  • 9.
    15·1 answer
  • Tasks you can perform online include which of the following?
    13·1 answer
  • Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject afte
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!