I have strings like following: i have tried .title() and capitalize() but not successes.
Input
"hello world"
"1hello world"
"hello world lol"
"1 2 2 3 4 5 6 7 8 9"
"1 w 2 r 3g"
"132 456 Wq m e"
"q w e r t y u i o p a s d f g h j k l z x c v b n m Q W E R T Y U I O P A S D F G H J K L Z X C V B N M"
Output
"Hello World"
"1hello World"
"Hello World Lol"
"1 2 2 3 4 5 6 7 8 9"
"1 W 2 R 3g"
"132 456 Wq M E"
"Q W E R T Y U I O P A S D F G H J K L Z X C V B N M Q W E R T Y U I O P A S D F G H J K L Z X C V B N M"
I have try this also, but when input string with more then one space then its got error.
str = "Hello World Lol"
for i in range(0,len(new)):
str += new[i][0].upper() + new[i][1:] + " "
print str