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
Select the correct answer.
Elanso [62]
The answer is c because it’s showing what different types of brushes and their specific styles
5 0
3 years ago
Create annotated playlist
Rashid [163]

Create annotated playlist

Step by Step Annotated Playlist

This is a step-by-step assignment sheet for your annotated playlist assignment. I will do my best to guide you!

Begin by identifying the song. Tell how long the song is, who the artist is, and specific information about the song.

  • Use the name of the song to attach a hyperlink to the song/video.

Attach a link for the lyrics (if it has lyrics)

  • Include copyright information.
  • Identify the Genre of the song (ex: Rock, Classical, Jazz, etc.)
  • Describe the song/section.
  • Describe what part of the video you would attach the song, and how the song would contribute to the mood or message of the video or slide show.
  • Do at least 5 songs for the rough draft. (We will be using a total of 8 for the final draft, so if you want more, add them!)
6 0
3 years ago
Which of the following binary (base-2) numbers is LARGEST?
Lemur [1.5K]

Answer:

A. 11000000

Explanation:

A. 11000000 is 192

B. 01111111 is 127

C. 00000001 is 1

D. 10111111 is 191

Therefore, making A the largest.

7 0
3 years ago
You are in charge of five software development projects. The project characteristics of each of the sys are as follows:
wariber [46]

: have you found the solution?

6 0
3 years ago
Elena is working on a team project for her computer science class. Although the entire team is responsible for the project, some
Angelina_Jolie [31]

Answer:

It is because of a phenomenon called Social Loafing.

Explanation:

In social psychology, social loafing is when someone normally performs an activity with great effort and energy, but when is working in a group this effort is reduced to the minimum. These students maybe could be able to perform well if working by themselves, but since they are in a group, they just put little effort and let others do the job.

5 0
4 years ago
Other questions:
  • Jane is a postproduction crewmember for a film. Her responsibilities include arranging all the scenes that have been shot into t
    7·1 answer
  • After a file downloads, you can do any of the following except
    13·1 answer
  • If the wrong server edition is installed, what command can be used to change to a different edition?​
    5·1 answer
  • The application reliability team at your company this added a debug feature to their backend service to send all server events t
    6·1 answer
  • Which option allows you to view slides on the full computer screen?
    11·1 answer
  • You want to use a terminal emulation program to terminal into a series of Cisco routers. You will be managing these devices remo
    9·1 answer
  • Write a program in C++ or C that includes two different enumeration types and has a significant number of operations using the e
    15·1 answer
  • A plan to budget time for studying and activities is referred to as a study routine. study habits. study skills. a study schedul
    13·2 answers
  • Match each career to its various job roles. digital media coordinator digital media specialist photographer sound producer creat
    13·1 answer
  • How to tell what wifi your nest camera is connected to
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!