Write Python script that takes a string with multiple words and then capitalizes the first letter of each word and forms a new string out of it.
Answers
Explanation:
a = input("Enter string")
print(a.title())
In the above program input() function gets the input from the user and print statement along with title() prints the desired output.
This is a very simple program which uses "title()" which is a built-in function. This function helps the programmer to convert the first character of every word(text or string) to capital letter.
We have to be careful with this function while using apostrophe, because it capitalizes the character next to the apostrophe.
To Know More:
https://brainly.in/question/7680394
What is upper case and lower case in python programming language
https://brainly.in/question/9041859
How to change all the function arguments to lowercase in Python?
Answer:
string = input("Enter a string :- ")
lst = string.split()
for i in lst:
print (i.capitalize(), end = " ")