answer.
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]
2 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]2 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
Show how to define a view tot_credits (year, num_credits), giving the total number of credits taken by students in each year
andreev551 [17]

Hi! I'm a Digital Marketer Intern at hotels.ng and I have a moderate knowledge on programming.

First, your  question is not very explanatory. The term "view" is often used in back-end web development. A view is simply a Python function that takes a Web request and returns a Web response.

But I'm not sure this is what you want, so I'll just go ahead and write a python function involving class to return the total number of credits taken by a student.

I'll answer this question using Python.

class student(object):  

    credits = None

    year = None

    def num_credits(self):


       #get credit value

       self.credits = input("Enter the total number of credits: "  )


       pass

    def getYear(self):

        self.year = input("Enter current year: ")

        pass

    def tot_credits(self):

          TotalCredits = tempTotalCredits + self.num_credits

           print "Your  total credits are :"+" "+str(TotalCredits)




3 0
1 year ago
An app builder has created a report for sales people to view records from the custom object, some users have complained that the
Mila [183]

Answer:

There is a need for some people to see the total transparency of the records that are meant to be shared with a select group of people. There are certain things that can be done for this. The first one is that the sharing rules should be checked. To whom are the details shared with. The next one is the filters that are used.

These can be reported and changed accordingly. Lastly, the whole organization’s defaults can be checked. This is something that can be done when the previous methods that were done did not work that well. Once some changes are done, the people can check if they already work and if the records can be viewed.

Explanation:

8 0
1 year ago
Write a function PrintShampooInstructions(), with int parameter numCycles, and void return type. If numCycles is less than 1, pr
Finger [1]

Answer:

public static void PrintShampooInstructions(int numberOfCycles){

       if (numberOfCycles<1){

           System.out.println("Too Few");

       }

       else if(numberOfCycles>4){

           System.out.println("Too many");

       }

       else

           for(int i = 1; i<=numberOfCycles; i++){

               System.out.println(i +": Lather and rinse");

           }

       System.out.println("Done");

   }

Explanation:

I have used Java Programming language to solve this

Use if...elseif and else statement to determine and print "Too Few" or "Too Many".

If within range use a for loop to print the number of times

8 0
1 year ago
Read 2 more answers
Read the attached paper titled A Survey of Coarse-Grained Reconfigurable Architecture and comment on it. Make sure to specifical
Pani-rosa [81]

Answer:

lol

Explanation:

I NEED POINTS

5 0
1 year ago
If s=abcd is a string defined over Σ = {a,bc,d}then reverse of s is dcba.<br> Δ True<br> Δ False
Minchanka [31]

Answer:

True

Explanation:

If s=abcd is a string defined over {a,b,c,d}, it corresponds to a regular expression which can be represented using a finite automata. Then the reverse of the string essentially corresponds to another finite automata where the starting state becomes the accepting state and vice versa.Moreover all the directions of state transitions will be reversed for each of the transitions in the original automata.

With these modifications, the new finite automata will accept a string which is reverse of the original string ,namely, dcba and this string will ne part of the reverse language.

7 0
1 year ago
Other questions:
  • Suggest two other subtasks that may be performed in a dice game?
    15·2 answers
  • Graphical elements that precede each item in a list are known as​ __________.
    8·1 answer
  • Which Android application is used exclusively for sharing video content?
    12·2 answers
  • You are attempting to open a file containing a list of integer numbers, each on a separate line, and read them into Python as in
    6·1 answer
  • Cooper Technologies is a technology company that offers many IT services in Chicago. The company's services and products include
    6·1 answer
  • Which type of word processing programs enables us to include illustrations within the program?
    6·1 answer
  • A good way to avoid skids is to _____ when coming into a turn. A. accelerate B. decelerate C. counter steer D. cover brake
    8·2 answers
  • A Color class has a method getColorName that returns a string corresponding to the common name for the color, e.g., yellow, blue
    11·1 answer
  • Krista needs to configure the default paste options in PowerPoint 2016. Which area of the Options dialog box will she need to us
    14·1 answer
  • Which of the following could NOT be represented by a boolean variable?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!