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 should always buy the biggest camera bag that you can find for extra equipment
zysi [14]
False bbfderaddfdffffgfgdhgft
5 0
4 years ago
Read 2 more answers
Mention at least five devices used for digitizing data
creativ13 [48]
Answer:
1. Cloud Storage Solutions
2. Digital Communication Tools
3. Cloud ERP Systems
4. CRM Platforms
5. Digital Accounting Tools

For more information, please visit: https://www.gend.co/blog/the-digitisation-tools-with-the-biggest-impact-for-business?hs_amp=true

Hope this helps!!
3 0
2 years ago
If you wanted to buy a house that cost $150,000 and you knew you needed a down payment of five percent, how much would you need
andrew11 [14]

Answer:

7,500 is the answer

Explanation:

7,500 is 5% of 150,000

8 0
3 years ago
Look at the picture, list down the things you must do to make it more organize​
Oxana [17]

Answer:

The electrical cable

Explanation:

The most dangerous is the electrical cable to be organised as much as you can as in case any damage or not double insulation could cause a harm to the people.

7 0
3 years ago
If you could make another device "smart" and have
konstantin123 [22]

Answer:

I would 100% make myself a SmartToaster (Trademark Pending)

Explanation:

A simple explanation would be <em>I like toast</em>

7 0
3 years ago
Other questions:
  • When entering a function or formula in a cell, which is the first character you must type?
    15·2 answers
  • How does the movement of earth in space create cycles we all experience?
    7·1 answer
  • What is that black thing on my wall?
    9·1 answer
  • "The effectiveness of memory retrieval is directly related to the similarity of cues present when the memory was encoded to the
    11·1 answer
  • Given the network 192.168.100.0/24, we are going to segment this network into two subnets, Subnet A and Subnet B. The hosts requ
    10·1 answer
  • My computer just fried anybody know why it did that?
    14·2 answers
  • Why is know app downloading in my android phone even if I have 900 MB ???
    8·2 answers
  • What is the different between the patch Tool and the Headling Brush tool?​
    5·1 answer
  • Slayyy queeen slayyy
    12·2 answers
  • Why is it necessary to have a w-2 or 1099 form when using tax preparation software?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!