+ 2
What's the problem here?
11 Respuestas
+ 1
if you need to store the changed string just assign it to a variable
x="ABC"
y=x.lower()
print y
>>>abc
+ 2
the problem is the return statement
code which is after it wont ever execute
you should have it as last instruction
+ 2
Where should I have it?
+ 2
should be somethin like:
if foo:
some code
return var
you could use capitalize() method which does exactly what you are tring to do
+ 2
Thanks!
+ 1
you are immediately returning something in ur function so the rest of it wont be executed
+ 1
glad I could help! ☺
+ 1
Is there a begginer way to reverse capitalize?
+ 1
why use capitalization, just always make the string either all lowercase or all uppercase. much easier
+ 1
str = "ABC"
print str.lower()
>>> abc
+ 1
Ok