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
Find the volume of the rectangular prism.<br>1<br>6 cm<br>32<br>cm​
Assoli18 [71]

Answer:

192 centimeters.

Explanation:

V= length x width x height

6 0
3 years ago
What is it called when you make predictions within given data?
denis23 [38]
<span>When a researcher uses given data to make a prediction, this is known as a hypothesis. The hypothesis generally serves as a starting point for future research, allowing a researcher to further develop their theory through additional testing, observation, and, if necessary, revision to the current hypothesis.</span>
4 0
3 years ago
Write a function called is_even that takes one parameter and returns a boolean value. It should return True if the argument is e
Nikitich [7]

def is_even_number(n):

   return True if n % 2 == 0 else False

while True:

   number = int(input("Enter a number: "))

   if number == 0:

       break

   else:

       if is_even_number(number):

           print("Even")

       else:

           print("Odd")

I wrote my code in python 3.8. I hope this helps.

6 0
3 years ago
Game Design Help please
valina [46]
This game on cool math
4 0
4 years ago
Wich of the following is true about how your skill set relates to a future career
larisa [96]

The statement which is true about how your skill set relates to a future career is: D. Skills from part-time jobs and volunteer work may prove beneficial in future jobs.

<h3>What is a career field?</h3>

A career field can be defined as a series of sequential jobs that use similar skills, and they typically lead to the short and long-term career goals of an individual such as an employee.

<h3>What is a skill acquisition plan?</h3>

A skill acquisition plan can be defined as a written plan that is used to outline the goals, objectives, materials, teaching methods, and data collection techniques for teaching trainees or employees, a specific skill or set of skills.

This ultimately implies that, skill acquisition plans include all of the following:

  • Goals
  • Objectives
  • Materials
  • Data collection

In conclusion, we can infer and logically deduce that the statement which is true about how your skill set relates to a future career is that skills you acquired from part-time jobs and volunteer work may prove beneficial in future jobs.

Read more on skill acquisition plans here: brainly.com/question/15352575

#SPJ1

Complete Question:

Which of the following is true about how your skill set relates to a future career? (1 point)

Employers like to hire people with only full-time job experience.

Employers consider subject-specific skills for new positions.

Skills learned in high school should not be included.

Skills from part-time jobs and volunteer work may prove beneficial in future jobs.

5 0
2 years ago
Other questions:
  • Write a method called all Less that accepts two arrays of integers and returns true if each element in the first array is less t
    12·1 answer
  • Which features can Danica use to fix the issue
    5·1 answer
  • Complexities of communication are organized into successive layers of protocols: lower-level layers are more specific to medium,
    8·1 answer
  • How do you change colors for presentation to blue warm in power point?
    11·1 answer
  • List the five body functions that monitor homeostasis.
    7·1 answer
  • Ryan needs to see the space available to insert content on a slide in his presentation. Which feature of a presentation program
    10·1 answer
  • E-mail played a role in political upheavals in Europe because it became an important means of communication in Europe. E-mail, c
    13·1 answer
  • Points! taga pilipinas ba kayo?​
    10·1 answer
  • Project: Digital Media and Business
    9·1 answer
  • How do you flatten a 2D array to become a 1D array in Java?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!