- 1
First letter in word - uppercase
s=input().strip() for i in range(len(s)): print(s[0].capitalize, end='') sample input: sHe is hAppY Sample output: SHe Is HAppY but this is showing She Is Happy plz help me out
7 Answers
+ 6
Here is a code that should work and also keeping the whitespaces:
inp = 'sHe is x hAppY'.split(' ')
for pos,i in enumerate(inp):
if len(i) > 1:
inp[pos] = i[0].upper() + i[1:]
else:
inp[pos] = inp[pos].upper()
print(''.join([str(i) if i == ' ' else str(i + ' ') for i in inp]))
+ 5
My try!!
Hope it's helpful for you.😊
https://code.sololearn.com/cRzb6NZGlp8q/?ref=app
+ 4
uma, do you want to keep the whitespaces as the are?
+ 1
I think the white spaces are not matching
Anyways thanks!
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥
+ 1
Yes , ur code works
Thanks a lot
Lothar 😇
+ 1
Great ,
That's nice
Thank you so much 𝕊𝕆𝕌𝕄𝕐𝔸 𝕊𝔸ℍ𝕌
0
But all the letters turns into lowercase
Like I need SHe Is HAppY
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥