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
Write the function greeting that takes a string as input. That string will be formatted as Name Age Hobby, without any punctuati
Dmitriy789 [7]

Answer:

The function in Python is as follows:

def greetings(details):

   details = details.split(' ')

   print('Hello, '+details[0]+'!, I also enjoy '+details[2])

Explanation:

This defines the function

def greetings(details):

This splits the input string by space

   details = details.split(' ')

This prints the required output

   print('Hello, '+details[0]+'!, I also enjoy '+details[2])

After splitting, the string at index 0 represents the name while the string at index 2 represents the hobby

4 0
2 years ago
When companies charge different prices for the same product, they're using
Maksim231197 [3]

Answer: When companies charge different

prices for the same product, they're using

B.) Dynamic Pricing

Is the most accurate

Explanation: If a firm can find a way to charge every customer the price he/she values a good at, the firm can capture more profits than it could with a single price, in a given market.

7 0
1 year ago
The number of pixels displayed on the screen is known as ​
puteri [66]

Answer: Resolution

Explanation: The total number of pixels that can be displayed on the screen at a time is called the resolution of the screen. This resolution is normally described in the pair of numbers, such as 2560 x 1440. This means, the computer screen is 2560 pixels wide and 1440 pixels tall.

4 0
3 years ago
Please help me with this! I’m using Python 3
IgorLugansk [536]

Something like this?

h1 = int(input())

m1 = int(input())

s1 = int(input())

h2 = int(input())

m2 = int(input())

s2 = int(input())

s = h2*3600 + m2*60 + s2 - (h1*3600 + m1*60 + s1)

print(s)

3 0
2 years ago
What year was internet inverted
alex41 [277]

\large\blue{\mid{\underline{\overline{\tt { →\:January \:1, 1983}\mid}}}}

  • ARPANET→Advanced Research Projects Agency Network
  • the forerunner of the Internet.

\purple{\rule{15mm}{2.9pt}} \red{\rule18mm{2.5pt}} \orange{ \rule18mm{2.5pt}}

\sf{\:мѕнαcкεя\: ♪...}

5 0
2 years ago
Other questions:
  • The unique global address for a web page or other resource on the internet is called the ________.
    7·1 answer
  • Allows an administrator to query a dns database and find the host name associated with a specific ip address or
    15·1 answer
  • You are adding new wires in your building for some new offices. The building has a false ceiling that holds the lights and provi
    8·1 answer
  • What would be a good hash code for a vehicle identification that is a string of numbers and letters of the form “9x9xx99x9xx9999
    9·1 answer
  • Please help me with opinions, ideas, any websites that would help, or chart, article, video, or podcast to help support your pos
    10·1 answer
  • It keeps saying “something is going wrong oops!” when i click on my brainly notifications what do I do
    9·1 answer
  • A(n) ______ has moving mechanical parts, which makes it less reliable than solid-state drives, but its metal platters are sealed
    9·2 answers
  • The average numbers of shares a piece of content receives is known as its:
    7·1 answer
  • ⚠VERY IMPORTANT MESSAGE⚠
    7·2 answers
  • WILL GIVE A BRAINLIEST!!! PLS HELP!!!
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!