Processing Strings | Sololearn: Learn to code for FREE!


Processing Strings

How do you capitalize/lowercase text, and reverse the order of letters?

3/6/2017 6:06:04 PM


5 Answers

New Answer


The last one is slice notation: list[i] access to item at index i list[start:stop] return a range copy from index start ( included ) to stop ( not included ) list[start:stop:step] return a range, using a step. Not specifying a value set it as default 0 ( first item ) for start, and last item/index included ( last index+1 ) for stop. Negative step would produce a reversed copy...


upper() lower() [::-1]


upper and lover are methods and no functions. so you should print text.upper() and not upper(text)


@Alvaro I get how you use the first two, but how do you do the last one?


yous should do list=list[::-1]