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
Delvig [45]
4 years ago
11

Write a loop that counts the number of space characters in a string. Recall that the space character is represented as ' '.

Computers and Technology
1 answer:
Jlenok [28]4 years ago
3 0

Answer:

I am writing Python program.

string = input("Enter a string: ")

print(string.count(' '))

Explanation:

The first statement takes input string from the user.

input() is used to read the input from the user.

The next statement uses count() function to count the number of times the specified object which is space ' ' here occurs in the string.

The print() function is used to return the number of times the space occurs in the string entered by the user.

Output:

Enter a string: How are you doing today?

4

The screenshot of program and its output is attached.

You might be interested in
Which of the following statements about networking IS CORRECT? A. Networking is only for professionals in certain careers. B. Ne
DENIUS [597]

Answer:

Toca un clip para pegarlo en el cuadro de texto.

6 0
3 years ago
Read 2 more answers
If one of the data values being entered into a table by the INSERT command violates an existing constraint, the remaining portio
Fittoniya [83]

Answer:

False

Explanation:

If one of the data values being entered into a table by the INSERT command violates an existing constraint, the database raises an error and none of the records aimed in the insert command is added.

Thus, in insert command syntax and column specifications has to be met in order to add any values being entered.

8 0
3 years ago
A proper divisor of a positive integer $n$ is a positive integer $d < n$ such that $d$ divides $n$ evenly, or alternatively i
juin [17]

Answer:

The program written in Python is as follows:

<em>See Explanation section for line by line explanation</em>

for n in range(100,1000):

     isum = 0

     for d in range(1,n):

           if n%d == 0:

                 isum += d

     if isum == n * 2:

           print(n)

Explanation:

The program only considers 3 digit numbers. hence the range of n is from 100 to 999

for n in range(100,1000):

This line initializes sum to 0

     isum = 0

This line is an iteration that stands as the divisor

     for d in range(1,n):

This line checks if a number, d can evenly divide n

           if n%d == 0:

If yes, the sum is updated

                 isum += d

This line checks if the current number n is a double-perfect number

     if isum == n * 2:

If yes, n is printed

           print(n)

<em>When the program is run, the displayed output is 120 and 672</em>

4 0
4 years ago
URGENT!! What is the most suitable use for bitmap images?
ELEN [110]

B. Photographs

Logos, line drawings, and animations are always better as vector images, which basically means the image has an infinite resolution.

7 0
3 years ago
Read 2 more answers
Discuss three ways you could (or currently do) use the Excel software in your personal or professional life. Provide examples an
professor190 [17]
Both in my personal and professional life, I use the Excel software in order to create tables and lists. It's much easier to do that in Excel rather than in Word, for example, because Excel was actually created for that purpose, whereas Word was created for writing, above all. I use Excel for work to create tables of various things, such as names, emails, payments, etc. whereas I use it in my personal life to create lists of things such as movies, books, etc.
3 0
3 years ago
Other questions:
  • Which of the following actions should you take when turning left at an intersection?
    11·1 answer
  • Why was the movable type of the printing press such a breakthrough for publishing?
    15·2 answers
  • How to program chamberlain universal garage door opener?
    13·1 answer
  • I accidentally pressed the challenge button while I was scrolling through. I didn't mean to press that challenge, instead of the
    11·2 answers
  • in a mechanism ,when the input goes from a small gear to an output which is a larger gear the speed will _____
    10·1 answer
  • En que parte del mall del rio venden tarjetas de google play en cuenca​
    7·1 answer
  • Write the definition of a class WeatherForecast that provides the following behavior (methods): A method called set_skies that h
    13·1 answer
  • V. ASSESSMENT (Time Frame:
    7·1 answer
  • You have purchased a new LED monitor for your computer. On the back of the monitor, you see the following port (pictured below).
    9·1 answer
  • Create a defined name for range b6:e6 using walkup as the range name
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!