Hey, i’m struggling with the answer to this question. I pretty much did it myself then looked to the answer sheet and added the extra bits i was missing. However, even with the answer i’m struggling to get it to sort the alphabet. Instead it gives the below;
1 Like
Hi @jakegoode95,
Well, this is happening because some of your array elements have space in the string. Since space take more precedence over the letter, that variable is printed out. Now, in your list, the string with k is " K "
and not "K"
. If you remove the spaces and then try sorting, you will resolve the issue.
Hope this helps.
1 Like
Thanks Malik!
Didn’t notice that at all, thanks for showing me!
1 Like