I'm working on a project in Python I was given by someone. What happens is, I'm given three name:score pairs, and then I have to sort them however the user chooses: alphabetically, ascending scores, or descending scores. Right now, I'm just working on the alphabetic sorting. That's easy, Python has a
sort() function which I could use and be done with the challenge pretty quickly. But this where it gets hard:
You may not import any modules, and you may not call any sorting methods/functions.
I'm having a hard time figuring out how to sort the names alphabetically without a humongous chunk of inefficient, bloated, and annoying code.
Is anyone able to help me figure this out?
I'm doing this for fun, so don't really need to keep to the rules, but I would like to as much as possible, and one of them is:
you may not use code from websites, so don't bother looking any up.
So please keep that in mind and just poke me in the right direction, rather than showing me the complete code you would use