What's the problem here? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
11 Answers
+ 1
if you need to store the changed string just assign it to a variable x="ABC" y=x.lower() print y >>>abc
1st Feb 2018, 7:18 PM
Kuba H
Kuba H - avatar
+ 2
the problem is the return statement code which is after it wont ever execute you should have it as last instruction
1st Feb 2018, 6:50 PM
Kuba H
Kuba H - avatar
+ 2
Where should I have it?
1st Feb 2018, 6:54 PM
Raphael Shay
Raphael Shay - avatar
+ 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
1st Feb 2018, 6:56 PM
Kuba H
Kuba H - avatar
+ 2
Thanks!
1st Feb 2018, 7:07 PM
Raphael Shay
Raphael Shay - avatar
+ 1
you are immediately returning something in ur function so the rest of it wont be executed
1st Feb 2018, 6:48 PM
Jeremy
Jeremy - avatar
+ 1
glad I could help! ☺
1st Feb 2018, 7:08 PM
Kuba H
Kuba H - avatar
+ 1
Is there a begginer way to reverse capitalize?
1st Feb 2018, 7:11 PM
Raphael Shay
Raphael Shay - avatar
+ 1
why use capitalization, just always make the string either all lowercase or all uppercase. much easier
1st Feb 2018, 7:12 PM
Jeremy
Jeremy - avatar
+ 1
str = "ABC" print str.lower() >>> abc
1st Feb 2018, 7:14 PM
Kuba H
Kuba H - avatar
+ 1
Ok
1st Feb 2018, 7:15 PM
Raphael Shay
Raphael Shay - avatar