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
irinina [24]
3 years ago
11

2. Write a program with a function that accepts a string as an argument and returns a copy of the string with the first characte

r of 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:
Oduvanchick [21]3 years ago
4 0

Answer:

Following are the code to this question:

def capital(val):#defining a method that takes string value as parameter

   x=True#defining boolean variable

   r=''#defining string variable  

   for i in val:#defining loop to convert the first character into upper case

       if i.isalpha() and x:#defining condition to check input value is string

           r=r+i.upper()#change value into uppercase and hold value in r variable

           x=False#assign value false in boolean variable

       elif i=='.' or i=='?' or i=='!':#check symbols

           r=r+i#add value in r variable

           x=True#assign value True in boolean variable

       else:

           r=r+i#add all value in r variable

   return r#return r variable value

val=input()#input value in val variable

print(capital(val))#called the function which print the return value

Output:

please find the attachment.

Explanation:

  • In the above python program, a method "capital" is declared, which accepts a "val" a string value in its parameter, and inside the method one boolean "x" and one string "r" variable is used, in which r stores return value.
  • In the next step, for loop is declared, inside the loop, the conditional statement is used, in if the block it checks string value and converts the first character into upper case and assigns value false in the boolean variable.  
  • In the next step, elif block is defined that adds value in r variable and at the last, it will return function value, at the last step "val" variable is declared that input value from the user and pass into the method and print its return value.

You might be interested in
What is the QOS model?
Andre45 [30]

Answer:

Quality Of Service

Explanation:

Technology that manages data traffic to reduce packet loss, latency and jitter on the network. QoS controls and manages network resources by setting priorities for specific types of data on the network.

5 0
3 years ago
At a local marketing firm, Steve is the lead Web developer and is responsible for working with customers on their Web designs, d
attashe74 [19]

Answer:

All of the above.

Explanation:

Understanding that he must create a unique domain name for each client

Being able to work with HTML

Understanding of the World Wide Web and how hyperlinks work

All of these would be a critical skill Steve must have to be able to perform his job.

6 0
3 years ago
Which Additional Authorization List item can replace the hook at the end of the winch cable for fastening the cable to some load
satela [25.4K]

Answer:

Shackle

Explanation:

A winch may be defined as a mechanical device which is used to pull in or let out the rope or cable maintaining its tension. It can also adjust the tension of the cable or the rope.

It is mainly used in tow trucks, elevators and steam shovels.

Shackle is one of the additional authorization list of a vehicle with a winch which can be used to replace the hook of the cable of the winch.

8 0
3 years ago
when using screwdrivers you should always be aware that the screwdriver blade might slip out of the slot and strike you in the .
ELEN [110]

When using screwdrivers you should always be aware that the screwdriver blade might slip out of the slot and strike you in the:

  • -hand
  • -eye
  • -mouth

<h3>What is a Screwdriver?</h3>

A screwdriver is said to be a kind of a modern tool that can come in a manual or powered type and it is one that is often used for turning screws.

Note that a typical simple screwdriver is one that has a handle as well as a shaft and it is also one that is often ending in a tip where a given user can be able to put their hands into the screw head before turning the handle.

Therefore, when using screwdrivers you should always be aware that the screwdriver blade might slip out of the slot and strike you in the:

  • -hand
  • -eye
  • -mouth

Learn more about screwdrivers  from

brainly.com/question/20717091

#SPJ4

3 0
1 year ago
Which is a possible benefit of having a good credit history?
Solnce55 [7]

I believe low interest rate is the correct answer

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is a device driver?
    9·2 answers
  • List and the deference between MS access objects​
    8·1 answer
  • Assume that the following code exists inside a method of SomeClass, and that this code compiles without errors:
    13·1 answer
  • Janelle went to update the last name for one of her group contacts. She double-clicked on the contact, changed the last name, an
    12·2 answers
  • Use the SQL Server Management Studio to complete the following.
    9·1 answer
  • In a system using the relocatable dynamic partitions scheme, given the following situation (and using decimal form): Job Q is lo
    5·1 answer
  • OSHA standards appear in the ___________ and are then broken down into ____________.
    9·1 answer
  • Question 3 of 10
    7·1 answer
  • What does IDLE stand for
    11·2 answers
  • I made a mistake. I'm building my first PC and I bought a Ryzen 7 3800x and planning on getting a 2070 super (if I can). What I
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!