+ 2

A string value containing more than 1 word is passed as the input(runtime) to the program(hint-use swapcase by splitting-string

input: tHiS is my book output: ThIs is my book

2nd Sep 2018, 5:14 AM
bharath
bharath - avatar
10 Answers
+ 2
great thanks for your help Anna
2nd Sep 2018, 7:45 AM
bharath
bharath - avatar
+ 1
Change the first line to sentence = input()
2nd Sep 2018, 6:17 AM
Anna
Anna - avatar
+ 1
Really? It does exactly what is asked. It capitalizes the first word and leaves all other words unchanged
2nd Sep 2018, 6:45 AM
Anna
Anna - avatar
+ 1
Oh. I didn't notice the capital I. In this case, change .capitalize() to .swapcase().
2nd Sep 2018, 7:35 AM
Anna
Anna - avatar
0
A string value containing more than 1 word is passed as the input(runtime) to the program(hint-use swapcase by splitting-string input: tHiS is my book output: ThIs is my book NOTE : the input must be at the runtime PYTHON
2nd Sep 2018, 6:11 AM
bharath
bharath - avatar
0
I changed but it's not giveing the correct output is mentioned in the question " Anna "
2nd Sep 2018, 6:23 AM
bharath
bharath - avatar
0
use the swapcase for the first word alone and the rest would be printed as such from the intput "Anna "
2nd Sep 2018, 6:24 AM
bharath
bharath - avatar
0
see the input : tHiS is my book output : ThIs is my book input -->tHiS converted by swapcase to output -->ThIs and see your output Anna
2nd Sep 2018, 7:32 AM
bharath
bharath - avatar
0
A string value containing more than 1 word is passed as input to the program it must print all the words starting with letter 't' input: I went to the movie output : to the Note:use ( startswith ) method PYTHON
2nd Sep 2018, 12:49 PM
bharath
bharath - avatar