Skip to content

Instantly share code, notes, and snippets.

@nuriyevn
Created May 1, 2021 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuriyevn/a02bd88ce8a740bbb7fc7e0b4a662c02 to your computer and use it in GitHub Desktop.
Save nuriyevn/a02bd88ce8a740bbb7fc7e0b4a662c02 to your computer and use it in GitHub Desktop.
def solve(s):
l = s.split()
new_list = []
stringLen = len(s)
newString = ''
awaitingWord = True
for i in range(stringLen):
if (s[i].isspace()):
newString += s[i]
awaitingWord = True
continue
else:
if awaitingWord == True:
newString += s[i].upper()
awaitingWord = False
else:
newString += s[i]
return newString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment