0

How do you use two methods on one string?

I have a sentence and I need to capitalize all of it and also sort it. Both methods I use work when I do .upper() or .sorted() on their own, but if I try to combine them with 'and' it doesn't work or if I make a for loop, I don't grasp for very well, it doesn't work either. I have also tried just appending one onto the other with a period, .upper().sorted() to no avail. I am very new to this and I thank you in advance for your patience.

23rd Dec 2019, 4:13 PM
Taylr Bell
Taylr Bell - avatar
1 Respuesta
+ 1
sorted() is not a string function, but a general function. If you want to achieve what you want, you can do sorted(string).upper()
23rd Dec 2019, 4:41 PM
coddy
coddy - avatar