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
Menus are attached to the windows by calling
Lemur [1.5K]

i dont know da answer

4 0
3 years ago
To paste text with the same formatting as the document in which it is entered, select _____ from the Paste menu. Keep Source For
SashulF [63]
Copy by command c and paste by command v
5 0
3 years ago
Read 2 more answers
Which type of loop only runs while a condition is true?
Oksanka [162]

Here is some ranting.

You haven't specified programming language. And every type of loop runs only when a condition is true (that is the definition of a loop).

And here is the answer.

Well, there is [code]for[/code], [code]while[/code] and in some languages even [code]do while[/code].

Hope this helps.

3 0
3 years ago
Read 2 more answers
When dealing with a person who is behaving violently you should argue with them. A. False B. True
mina [271]

The answer here would be A. False.

3 0
3 years ago
Which statement is true?
Alexeev081 [22]

Answer:

Bjarne Stroustrop published the first reference guide for C++

Explanation:

Bjarne Stroustrop is a computer scientist who created the C++ programming language while working at the AT&T Bell laboratory. He also published the first reference guide for the programming language.

In October 1985, the book, The C++ Programming Language, was published. It describes the c++ programming language and was the only documentation and reference guide for the programming language at the time. Newer editions have since been published.

7 0
3 years ago
Read 2 more answers
Other questions:
  • A typeface in which each character has the same width and is often used to display programming code is _
    8·1 answer
  • Pascal's Triangle is a triangular array in which every number represents the
    15·1 answer
  • Given the code segment below, complete the assignments as stated in the comments. struct aaa { int m; int nn; } struct bbb{ stru
    13·1 answer
  • A user calls to report that she is experiencing intermittent problems while accessing the wireless network form her laptop compu
    9·1 answer
  • One of your clients has opened a branch office in another state. Both the main office and the new branch office have fast, relia
    10·1 answer
  • Take two String inputs of the same length and merge these by taking one character from each String (starting with the first ente
    8·2 answers
  • Which type of file can be opened directly into Excel?
    15·1 answer
  • he superclass Student contains: a constructor that accepts a String corresponding to the name of the school the student attends
    15·1 answer
  • On his website, Mario has a video that visitors must click to play. He wants the video to play automatically when the page loads
    8·1 answer
  • Does anyone have Rblx? if so write your username
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!