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
hram777 [196]
3 years ago
6

4.5 Code Practice

Computers and Technology
1 answer:
dmitriy555 [2]3 years ago
7 0

i = 0

while True:

   user_input = input("Please enter the next word: ")

   if user_input == "STOP":

       break

   i += 1

   print("#{}: You entered {}".format(i,user_input))

print("All done. {} words entered.".format(i))

First we set i equal to zero so that we can keep track of how many words we input.

We set while True so that its a continuous loop until a certain condition is met to break out of the loop.

user_input is set equal to whatever word the user enters.

our if statement tells us to break out of the while loop if the user inputs "STOP"

If the user does not enter STOP i is set equal to itself plus 1. This just means we add one to i for every new word entered.

Then we print whichever word is entered.

After the while loop, we print All done and the quantity of words entered.  

You might be interested in
Which activity does not allow a person to perform any work while at the shop
polet [3.4K]

Is it apprenticeship???:D

5 0
3 years ago
Why do Selection Sort and Insertion Sort’s outer loops run 11 iterations if there are 12 elements in the array?
laiz [17]

Answer:

The final case in selection sort is trivially sorted.

The final iteration in insertion sort is not needed.

Explanation:

For selection sort, you make sub arrays and find the smallest element placing it in the front and repeat until sorted.  This guarantees the final element will already be the greatest element, thus it is trivially sorted.

For Insertion sort, you use the initial element and compare it to the previous element and swap if the current is larger than the previous.  Using this sort, you will always perform n-1 comparisons where n is the total amount of elements in the array.  Thus, there are only 11 iterations for a 12 element array.

Cheers.

3 0
3 years ago
What includes two or more private, public, or community clouds, but each cloud remains separate and is only linked by technology
Ilya [14]

Answer:

hybrid cloud

Explanation:

hybrid cloud is a cloud environment that employs both public and private cloud services.

Hybrid cloud gives businesses more flexibility and greater efficiency in coverage due to its ability to move files between public and private cloud.

7 0
3 years ago
Write a chemical reaction to show that nitric acid contains nitrogen​
sleet_krkn [62]

Answer:

HNO3 &NO2

Explanation:

7 0
3 years ago
As a computer science student, which career you will select and what do you predict about the future of that specific IT-Career.
miv72 [106K]

Answer:

A cyber security agent

Explanation:

That will mean protecting organizations from being hacked by other ethical hackers

4 0
3 years ago
Other questions:
  • wHAT ARE THE 5 LAYERS in the internet protocol stack andwhat are the principal responsibilities of eack of theselayers.?
    12·1 answer
  • Which of the following people choose a career path for the right reasons
    12·2 answers
  • When sketching out your Web site you create a clear and straightforward site map that divides the Web site content into a logica
    9·1 answer
  • What is the largest value that can be represented by 6 binary digits? .
    5·1 answer
  • I need help getting earbuds please help
    11·2 answers
  • PLEASE HURRY!!!!
    8·2 answers
  • How would you delete a slide from your presentation after selecting it?
    14·1 answer
  • Why does this website have so many copies of plagiarism?
    5·1 answer
  • How to beat level 50 in give up robot 2
    5·1 answer
  • Why does a computer need memory​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!