Chris Clifton via Tutor wrote:
> I have been practicing with strings. Splitting them, joining them,
> changing case. All has been going well but came across a exercise in one
> of the code practice sites that has you changing the case of different
> characters in a string. Anything in upper cas
On 03/08/16 00:30, Alan Gauld via Tutor wrote:
>> if item == item.lower():
I meant to add that the string islower() method is probably
more readable:
if item.islower()
Also that you could use a list comprehension to do this without
converting to a list initially:
def conveert(text):
On Tue, Aug 2, 2016 at 7:59 AM, Chris Clifton via Tutor
wrote:
> My Logic: Since a string is immutable, I converted it to a list to separate
> out the characters and keep them in order. Idea is to change the case of the
> characters in the list then run a join to convert it back to a string.
On 02/08/16 15:59, Chris Clifton via Tutor wrote:
> My Logic: Since a string is immutable, I converted it to a list
That is certainly one approach but your solution has some snags.
In fact its probably not necessary unless you want to play with
big strings. You could just build a new string from
Hello Everyone,
I have been practicing with strings. Splitting them, joining them, changing
case. All has been going well but came across a exercise in one of the code
practice sites that has you changing the case of different characters in a
string. Anything in upper case is converted to