I cheated and peeked again at the solution :)
After five days, I think I needed help.
But it was still a very good day.
I learned lots.
When I started this little project, I saw videos about
namedtuples and then kinda forgot that they would be of some use to me in my project itself.
That realisation came yesterday.
Like they say, it happened very slowly and then all at once! I wrote up a quick workflow of how the program was supposed to work on paper.
And then I had a decisison to make.
Do I peek at the answer? or not?
In the end, I did.
I wanted confirmation of my thought process, and realised that if I was going to figure out the code itself, this would take much, much longer.
Besides, writing Python will come to me if I stick with this as I have been doing, so no guilt about copying code.
The instructors did solve the problem, exactly the way I envisioned it in my head :)
And the code, to my inexperienced fingers was tricky. (I don’t know lambdas or expressions in general and the instructor uses them liberally; a dictionary expression to populate a dict and a lambda to sort a list)
However I take small comfort in the fact, that I did, write one third of the code all by myself.
Just goes to show, how little fluency I have with the language.
But still! I am happy I got my thinking straight :)