Skip to content

Instantly share code, notes, and snippets.

@sameerg07
Created June 4, 2021 04:29
Show Gist options
  • Save sameerg07/42b8f6025275a1c3deb8fe82516fa216 to your computer and use it in GitHub Desktop.
Save sameerg07/42b8f6025275a1c3deb8fe82516fa216 to your computer and use it in GitHub Desktop.
Convert first letter to capital in each word of a string python
# Read the input string
input_string = input()
# Write your code here
nl = input_string.split(" ")
for i in range(len(nl)):
nl[i] = nl[i][0].upper() + nl[i][1:]
print(' '.join(nl))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment