Coding Update 5
I am a little bit procrastinating by doing this but I'm tireddd.
Apparently a lot of coders keep a rubber ducky to talk to about their code, so I got one too. Did you know it actually helps? Thanks rubber ducky.
More below, as per usual.
I solved my first problem all on my own yesterday.
Basically, I had to write a program to make a collection of Albums based on user input. At first it worked fine, but then it wanted me to amend the code to allow users to input the number of tracks. As soon as I tried to do that though, my whole code exploded lmao.
See that comment after records? I was trying to figure out why my code was only printing the last input. That ended up being because the dictionary was being created in the while loop, so it was endlessly resetting. You live and learn.
But anyway, how I solved the songs input?
I couldn't figure out how to put the songs ALSO into the dictionary, so I ended up creating a second list to store the track numbers. So each input creates the (artist, album) and then the tracks are stored in the song list.
Then it just pulls (pops) the first number in the list for each input. It lines up perfectly, no matter how many inputs it takes.
I don't think it was QUITE what the problem wanted me to do, but it worked out and that was all that matters.
Blocks of code are for you Beau, since you asked! Also enjoy my comment lines haha
I also mentioned at the start about talking to rubber ducks? From what I understand it started because programmers were getting frustrated and breaking things. So someone got a rubber ducky to talk to, cause you can't get mad at a rubber ducky. And apparently it worked! Talking about your code out loud helps you walk yourself through it (or to someone else if you've got someone to listen).
It worked for me too! I was getting super frustrated, so I walked away from my code for a bit, got a drink and a snack. Then I sat down and talked through my code and was like "WAIT A SEC!"
And here we are. Problem solved.
Is it the cleanest or most efficient? Probably not. But I'm really proud of figuring this one out on my own, without looking at someone else's code to figure it out.
Anyway, now I'm learning about classes and I have no idea what any of that is! So here's hoping I don't fry my brain!
Enjoy your weekends everybody!
-Kit












