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
Basile [38]
4 years ago
10

Write a program that allows users to enter a series of numbers and displays frequency of each number. Implement the following: 1

. The user can enter a maximum of 20 numbers or enter-1 to end the series 2. Only numbers between 0..9 is allowed (or -1 ); if the user enters a number outside the valid input, inform the user and ask them to enter a valid number 3. Display the frequency of each number in the output. If the user input is 0,0,1,2,2,4,5,8,8,8,9,9, -1 the output will be:
Computers and Technology
1 answer:
Alex777 [14]4 years ago
6 0

Answer:

zero = one = two = three = four = five = six = seven = eight = nine = 0

while True:

   number = int(input("Enter a number: "))

   if number == -1:

       break

   elif 0 <= number <= 9:

       if number == 0:

         zero += 1

       elif number == 1:

         one += 1

       elif number == 2:

         two += 1

       elif number == 3:

         three += 1

       elif number == 4:

         four += 1

       elif number == 5:

         five += 1

       elif number == 6:

         six += 1

       elif number == 7:

         seven += 1

       elif number == 8:

         eight += 1

       elif number == 9:

         nine += 1

   else:

       print("Invalid input!")

print("0 -> " + str(zero) + "," + " 1 -> " + str(one) + "," + " 2 -> " + str(two) + "," + " 3 -> " + str(three))

print("4 -> " + str(four) + "," + " 5 -> " + str(five) + "," + " 6 -> " + str(six) + "," + " 7 -> " + str(seven))

print("8 -> " + str(eight) + "," + " 9 -> " + str(nine))

Explanation:

Initialize the variables to hold the count for each digit

Initialize a while loop that iterates until a specified condition is reached

Inside the loop:

Get a number from the user and check

If the number is -1, stop the loop

If it is between 0 to 9, increase corresponding count value by 1

If it is out of range, print an error message

When the loop is done, print each count variable

You might be interested in
Which of the following can computer maintenance software determine?
Softa [21]

Answer:

A

Explanation:

Becuase i picked that and i git it right

7 0
3 years ago
A _ is the acknowledgment of a potential noncomformity, or an opinion regarding an issue that is not covered by a standard
sleet_krkn [62]
Assumption - hope this helped took the test and got 100
5 0
3 years ago
On many advanced routers and switches, you can implement QoS through bandwidth management, such as __________, where you control
Mila [183]

Answer:

c. traffic shaping

Explanation:

A traffic shaping system is one that allows to adapt the incoming data traffic that comes from some node of the network giving it a special treatment called conformation of accepted traffic and thus allowing the frames to be forwarded through the network of data under traffic rules without having gone through some traffic shaping method, this can be detected as non-conforming traffic at the edge of access to the discarded metropolitan network.

Traffic shaping is a mechanism that alters the traffic characteristics of the cell flow of a connection to achieve better network efficiency while maintaining QoS objectives or in order to ensure that the cell flow conforms to traffic parameters according to the leaky bucket algorithm configuration of the traffic contract. Traffic shaping can be used in ATM, for example, to reduce peak speed, limit the length of the burst by means of adequate spacing of cells over time. The use and location of this function is network specific.

5 0
3 years ago
What is a non-example of job outlook.
Papessa [141]

Answer:

Before you choose a career you should find out what its job outlook is. ... employed in a particular occupation over a set period, for example, two years, five years or ... 2% and 4%); Have little or no change (a decrease or increase of 1% or less) .

Explanation:

4 0
3 years ago
Which disclosure paradigm has as its assumptions that 1) an attacker will learn little or nothing from disclosure; 2) Disclosure
nekit [7.7K]

The  disclosure paradigm has as its assumptions that an attacker will learn little or nothing from disclosure is known as Open source.

<h3>What is open source?</h3>

An  Open source is known to be a term that connote that is said to be an Open source software set up to be publicly used by people.

Therefore, The  disclosure paradigm has as its assumptions that an attacker will learn little or nothing from disclosure is known as Open source.

Learn more about Open source from

brainly.com/question/6065176

#SPJ1

3 0
2 years ago
Other questions:
  • What might be one reason why a stock becomes more valuable over time
    5·1 answer
  • NEED HELP FAST
    13·2 answers
  • Help me out for this one
    12·1 answer
  • "Write a class named Car that has the following data attributes:" _ _year_model (for the car’s year model) _ _make (for the make
    12·1 answer
  • The scheme function (mult2-diff Ist) should take one argument, a list of numbers, and results in multiplying each number in the
    11·1 answer
  • What is the gauge manifold made of
    14·1 answer
  • Consider two communication technologies that use the same bandwidth, but Technology B has twice the SNR of technology A. If tech
    14·1 answer
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
    6·2 answers
  • Why is it important to prepare the farm resources before you start working? explain​
    14·1 answer
  • How can i find these services
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!