Answer the question
In order to leave comments, you need to log in
Why is the element not being replaced?
Another cancer question from the ten-day helloworld
def capitalise():
global words
i=0
for elem in words:
if i == 0:
elem = ord(elem) - 32
elem = chr(elem)
words.replace(words[i], elem)
if elem == " ":
i = -1
i+=1
return words
words = input()
capitalise()
Answer the question
In order to leave comments, you need to log in
in the described task, everything is wrong, because here and here,
well, at the same time, familiarize yourself with what and how replace
does
and you can code it , but it’s better without it: in addition to the very delusional
nature of such an activity, words are not necessarily separated by spaces.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question