Is there any built in methods available to convert a string into Title Case format as such?
I am writing a program that takes a list of student names and sorts them to create a class roll. The list of names will be given on a one line separated by a single space.
My program should work like this:
Students: Peng Ivan Alan Jodi Macy
The students' names will always be in title case (the first letter capitalised and the rest of the name in lower case), and in alphabetical orderso far I have:
data = input("Students: ")print('Class Roll')data.sort()for s in data: print(s)
but it says that
sort is not an attribute of
str, so how do I do it?
How do I make the first letter of a string uppercase, but not change the case of any of the other letters?
"this is a test"->
"This is a test"
"the Eiffel Tower"->
"The Eiffel Tower"
I have sent a mail to an address with a suffix of @rediffmail. But instead i wrote @Rediffmail. As you can see the 'R' is capitalized when it is not supposed to be. What I want to ask is that will the email still reach the recipient?I tried testing it from gmail but it automatically changes the 'R' to 'r'.
How do I format a string to title case?