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
Nikitich [7]
3 years ago
8

Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character o

f each sentence capitalized. For instance, if the argument is "hello. my name is Joe. what is your name?" the function should return the string "Hello. My name is Joe. What is your name?". The program should let the user enter a string and then pass it to the function. The modified string should be displayed.
Computers and Technology
1 answer:
Alex Ar [27]3 years ago
7 0

Answer:

def capitalize_first(st):

   capitilized_list = []

   splitted_st = st.split(". ")

   for x in splitted_st:

       capitilized_list.append(x[0].capitalize() + x[1:])

   capitilized_st = ". ".join(capitilized_list)

   return capitilized_st

 

s = input("Enter a string: ")

print(capitalize_first(s))

Explanation:

Create a function called capitalize_first that takes one parameter, st

Create an empty list that will hold the capitalized strings

Split the given string using split function and put them in the splitted_st

Create a for loop that iterates through splitted_st. For each string in splitted_st, capitalize their first character and put them in the capitalized_list.

When the loop is done, join the strings in the capitalized_list using join function and set the joined string to capitilized_st

Return the capitilized_st

Ask the user for the string

Call the function with entered input and print the result

You might be interested in
On a network, a(n) ________ helps prevent data packets from colliding with each other.
KATRIN_1 [288]
On a network, a(n) Switches helps prevents data packets from colliding with each other.
4 0
3 years ago
The blue bar across the top of the screen informs you of the Screen Title, or what step you are on.
xeze [42]

Answer:

true

Explanation:

5 0
3 years ago
if a network security professional wants to connect some computers in the same building without it using a router what type of n
marta [7]

Answer:

 the MAC addresses of wireless NICs

Explanation:

8 0
3 years ago
Read 2 more answers
What is a man-in-the-middle attack​
VMariaS [17]

Answer: An attack where the attackers will interrupt a data transfer happening between parties and in which they will pretend to be the legitimate parties.

Explanation: For example think about two people writing letters to each other back and forth. However you, the attacker can intercept the letters and effectively change the message/contents of the letter going to the other person. This is probably not the best explanation, but simply put a man-in-the-middle attack is when an attacker interupts a transfer and pretends to be the legitimate source.

4 0
3 years ago
Read 2 more answers
Today encoding scheme has taken over ascII by what
harkovskaia [24]
I do not know, i really hope you dont fail!!!!!!!!!
7 0
4 years ago
Other questions:
  • If I were to install python in kali linux on a Acer 11 Chromebook and C730 would I be able to hack python with it since I have n
    15·1 answer
  • Ben buys an Olympus E-PL2 from Sony which starts malfunctioning. When he opts for an exchange, the customer representative says
    11·1 answer
  • When at the rightmost cell in a row, press the ENTER key to move to the first cell in the next row; do not press the TAB key.
    14·1 answer
  • How does form get its power natural gas
    14·1 answer
  • Usually, the same software that is used to construct and populate the database, that is, the DBMS, is also used to present ____.
    11·1 answer
  • When you purchase an item in a store, you may be charged __________.
    11·2 answers
  • In python
    9·1 answer
  • A sum of money is shared between 2 friends in the ratio 2 : 3. If the larger
    9·1 answer
  • Service and software companies typically have a high return-on-assets ratio because they require lower blank as compared to manu
    11·2 answers
  • What methods do you use when researching a complicated or difficult subject? What tools are most useful to narrowing down and va
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!