Mark your post as having spoiler content when it does (already did it for you this time).
Write print(friend) in the line below your for loop line (above the if), you'll see you're skipping values as I said.
There are some other problems with your code, like trying to get the length of a number instead of the length of the string.
That's not true, you could generate a new list instead of mutating the input value. In many languages where it exists, filter method returns a new array/list.
Your problem could be one of these:
You mutate the list you're using in the loop, then you skip some values because the index of the loop is incremented anyway (I think this may be your case).
The mutated list is used after passing by your function and expected values are calculated using it instead of the original list (not very likely here).
That's in general, I don't know if these apply to your case here.
Without actually seeing your code I can't say if it's one of these or another problem.
bro you didnt read the last line of the code
Ahh, the default case was the icing on top.
Please mark your post as having spoiler content next time.
See your code again.
This comment is hidden because it contains spoiler information about the solution
It sorts by the ASCII values as it says in the description. Here's a link for more info
http://support.ecisolutions.com/doc-ddms/help/reportsmenu/ascii_sort_order_chart.htm
yeah lol
Nice one. :-)
Can you elaborate?
i think that it uses the same logic behind sorting an array of strings.
he alsolutely joked, don't take it seriously guys xD
This comment is hidden because it contains spoiler information about the solution
It works for other cases because of the final else clause. The else is really all that is required for the program to work.
Mark your post as having spoiler content when it does (already did it for you this time).
Write
print(friend)
in the line below yourfor
loop line (above theif
), you'll see you're skipping values as I said.There are some other problems with your code, like trying to get the length of a number instead of the length of the string.
That's not true, you could generate a new list instead of mutating the input value. In many languages where it exists, filter method returns a new array/list.
Your problem could be one of these:
That's in general, I don't know if these apply to your case here.
Without actually seeing your code I can't say if it's one of these or another problem.
remove mutates the list, check if you're not skipping values like that, or if mutating the list changes the expected results.
Loading more items...