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
valentinak56 [21]
3 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]3 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
You are planning to depart on a flight from area 2 to area 4 in 12 hours. What weather is forecast to occur along your route?
Andre45 [30]
It depends on where you live!
5 0
2 years ago
Which extensions can help drive installs of your mobile app?
Iteru [2.4K]

The question above has multiple choices as follows.

<span>a.       </span>App extensions 

<span>b.      </span>Sitelink extensions

<span>c.       </span>Structured snippet extensions 

<span>d.      </span>RSLAs (remarketing lists for search ads)

The correct answer is (A) App extensions 


App extensions are a great way for people to access your website. They allow you to link to your tablet or mobile app from your text adds. If you want to drive app downloads, app promo ads might be the best option.

5 0
3 years ago
What are the challenges of photographing at night? Why did the photographer “paint” the waterfall with the flashlight?
lianna [129]
Because he needed ligh
7 0
4 years ago
Which OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
konstantin123 [22]

Answer:

User Interface

Explanation:

4 0
4 years ago
Write a function:
Elden [556K]

Answer:

what are the choices

:"

Explanation:

5 0
3 years ago
Other questions:
  • What formatting option is easiest to read when printed out
    12·1 answer
  • Ecommerce sites sell this to generate income
    11·1 answer
  • Which extension is appropriate for Word document templates?
    10·2 answers
  • 14. Convert 11110111 from binary to denary<br> (1 Point)
    12·2 answers
  • I need urgent help. which of these network has minimum data loss. a. LAN b. MAN c. WAN ​
    11·1 answer
  • Why do we need IP Addresses in order for the Internet to function properly?
    7·1 answer
  • What is single user operating system? Write two examples.​
    12·2 answers
  • Which term is used in object-oriented programming to reference characteristics of an object?
    15·1 answer
  • Ashley works for a company that helps hospitals hire new doctors. They have written a list of strategies that can be used to int
    12·1 answer
  • Please help with this coding question
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!