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 IDEs support multiple high-level programming languages? Select all that apply.
rewona [7]

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

This question is about integrated development environments (IDEs) that support multiple high-level programming languages.

All mentioned IDEs such as Eclipse, Visual Studio, and Xcode support multiple high-level programming languages except Linux.

Using Eclipse, you can do Java programming easily and can build Java-based programs, and also you can do android programming in Eclipse while importing required android settings and libraries. Visual Studio is a Microsoft IDE, in which you can build desktop, web, and mobile, and windows phone app easily using high-level programming. Xcode is an integrated development environment for macOS containing a suite of software development tools developed by Apple for developing software for macOS, iPadOS, iOS, watchOS, and tvOS.

While Linux is not an IDEs, it is an open-source operating system based on Linux kernel.

8 0
3 years ago
_________ is an alternative name for the main memory.help me​
Leni [432]
RAM
(Random Access Memory)
7 0
3 years ago
Read 2 more answers
Angelina, the outgoing student body president, has finished a report about the upcoming school election. She wants to add a bord
stepladder [879]

Answer: page background, page borders, color

Explanation: just did the assignment

4 0
3 years ago
Read 2 more answers
Blank includes websites that encourage interaction and connection among people businesses and organizations
liberstina [14]
C is your answer to this problem

4 0
3 years ago
Read 2 more answers
Which of the following identifies your location in a document? I-beam Icon Insertion Point Pointing Arrow
Delicious77 [7]
The answer is Insertion Point. In Microsoft Word, the insertion point is the blinking vertical line in the document. It will identify the location where you can enter or alter text on the page. When creating a new document, the insertion point is located in the top-left corner of the document. 
8 0
3 years ago
Other questions:
  • Linda has written a program that works well on various operating systems, but she needs to increase the readability of the progr
    14·1 answer
  • Write a program that reads a 4-bit binary number from the keyboard as a string and then converts it into decimal. For example, i
    11·1 answer
  • __________ is a website that offers a variety of Internet services from a single, convenient location.
    13·1 answer
  • Which type of view is created from the following SQL statement? CREATE VIEW balancedue AS SELECT customer#, order#, SUM(quantity
    15·1 answer
  • Which of the following does not illustrate the survey method of choosing a speech topic?
    6·2 answers
  • The numbering system we commonly use is called the decimal numbering system because it uses ________ symbols to represent all po
    5·1 answer
  • A posting error is:
    8·1 answer
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    11·1 answer
  • PowerPoint:
    7·2 answers
  • List how much hard disk capacity you recommend, and write a sentence explaining why.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!