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
valentinak56 [21]
2 years ago
10

4. Word Separator:Write a program that accepts as input a sentence in which all of thewords are run together but the first chara

cter of each word is uppercase. Convert the sentence to a string in which the words are separated by spaces and only the first word starts with an uppercase letter. For example the string “StopAndSmellTheRoses.” would be converted to “Stop and smell the roses.”
*python coding
Computers and Technology
1 answer:
pantera1 [17]2 years ago
8 0

sent = input("")

count = 0

new_sent = ""

for i in sent:

   if count == 0:

       new_sent += i

       count += 1

   else:

       if i.isupper():

           new_sent += " "+i.lower()

       else:

           new_sent += i

print(new_sent)

The above code works if the user enters the sentence.

def func(sentence):

   count = 0

   new_sent = ""

   for i in sentence:

       if count == 0:

           new_sent += i

           count += 1

       else:

           if i.isupper():

               new_sent += " " + i.lower()

           else:

               new_sent += i

   return new_sent

print(func("StopAndSmellTheRoses."))

The above code works if the sentence is entered via a function.

You might be interested in
Which code fragment would correctly identify the number of arguments passed via the command line to a Java application, excludin
blondinia [14]

Answer:

The answer is a. int count =args.length

Explanation:

Which code fragment would correctly identify the number of arguments passed via the command line to a Java application, excluding the name of the class that is being invoked?

a. int count = args.length;

b. int count=0; while (!(args[count].equals(""))) count ++;

c. int count = args.length - 1;

d. int count = 0; while (args[count] != null) count ++;

The answer is a. int count =args.length

args is a string array object, which contains set of all arguments. You can find the number of argument by using args.length.

8 0
2 years ago
A ____ is a software implementation of a computer that executes programs as if it were a real physical computer within the physi
Brums [2.3K]

Answer:

The answer is "Virtual machine ".

Explanation:

The VM stands for Virtual machine, it is a portable device, that operates on the actual hardware framework as a virtual software to its Processor like, ram, network access, and data. It is a project called hypervisor splits the assets of the system from both the hardware and distributes the resources directly.

  • It runs the program as if the host's internal memory is a true physical device, but is isolated from the host's underlying hardware.
  • It can run an operating system on your desktop in an app window, that functions as a full, separate device.
3 0
2 years ago
Computer hardware without software is useless while computer software without hardware is meaningless. Discuss. Plz provide exam
Dvinal [7]
<span>I agree with one small part, but disagree with the rest. A computer as hardware is a machine that can do what software tells it to. If the software is stored directly on the hardware and relatively immutable, they cal it firmware. If it is easily changed and updated they just call it software. If you remove that completely, yes, the hardware is difficult to use for more than door stops and paper weights. However, you do not need hardware to use software. Software is a concept. Software development can be abstracted from the hardware. Algorithmic thinking can be used for theory or applied to other topics that do not use computers. </span>
7 0
2 years ago
A technician has been asked to test an inkjet printer purchased 6 months ago that is being pulled from stock and put into use fo
kodGreya [7K]

Answer:

The answer to the following question is to Replace the cartridge with a new one.

Explanation:

An inkjet cartridge or ink cartridge is the component or container of the inkjet printer which contains the ink that deposited on the paper during the printing.  

Each of the inkjet cartridge reserve the one or more ink and the other procedure also adds a chip and electronic contacts which communicates with printer.

6 0
2 years ago
Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working. Describe each pos
ss7ja [257]

Answer:

Explanation:

If a function is not working, there are three possibilities to consider: There is something wrong with the arguments the function is getting; a precondition is violated. There is something wrong with the function; a postcondition is violated. There is something wrong with the return value or the way it is being used.

a. precondition

A precondition is a prerequisite. It's the thing that has to happen before something else happens. ... When it's a verb, precondition means to prepare something (or someone).

b)a postcondition

A postcondition is the states the system can be in after the use case has ended. Consider the following: The states described by pre- or postconditions should be states that the user can observe. "The user has logged on to the system" or "The user has opened the document" are examples of observable states.

c)As in any programming language, "return value" means the value that is returned by any sub-routine. All subroutines need not return values, sometimes return void (means nothing). Return values often indicate something about the completion of the task or result of an operation.

4 0
2 years ago
Other questions:
  • The development of the original personal computer (PC) was a(n) __________ innovation at the time, whereas adding a different ki
    8·1 answer
  • Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
    14·1 answer
  • 1. Show that the three security services-confidentiality, integrity, and availabilty- are sufficient to deal with the threats of
    10·1 answer
  • Printers produce _____ output. Displays produce _____ output. A _____ is an audio output device that converts text to speech. Ma
    11·1 answer
  • Leah wants to create a PowerPoint presentation for a history report about the progressive era in the 1900s. To
    6·2 answers
  • Give the Linux bash pipelined command that would take the output of the "cat /etc/passwd" command (that lists the contents of th
    5·1 answer
  • What are some reasons DNS is necessary? Check all that apply. A. It maps local addresses to simple names without editing hosts f
    7·1 answer
  • Which argument forces a writer to return to and change the input before resolving a “UnicodeError”?
    10·1 answer
  • Describe the output when the following code executes in 64-bit mode: .data dividend_hi QWORD 00000108h dividend_lo QWORD 3330002
    12·1 answer
  • What is a key differentiator of Conversational AI? It implements Natural Language Understanding (NLU) and other human-like behav
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!