General Question for Advice


#1

I have been struggling on almost all of the Practice Makes Perfect exercises I’ve attempted so far. My problem has not been so much with figuring out what to do to accomplish the task but rather with how to accomplish it using the python machinery. I’m trying to decide whether I should just continue pushing through and do my best with the Practice Makes Perfect exercises (often relying on either the hints or forum discussions), or if I’m better off going back through the earlier exercises in order to better learn the necessary machinery. Part of my issue is that currently I can only dedicate about an hour each day to learning this stuff, and my primary job involves learning other stuff, so it’s hard to keep all of it my mind.

Any advice appreciated. Thanks!


#2

both approaches have pros and cons, you should do what you feel is best

practices makes perfect section teaches a very important concept, which is to solve a problem. How to accomplish the given task, its exactly what this exercises teaches, and what programming is all about (coming up with a solution and implementing it)

so its worth to take your time, but you can also come back to it later.


#3

Consider the operations available to you (what can you for example do with a list?) and break down the “what” into such parts. Then, if you don’t know how to do each such part, describe that part in google’s search box. “python create string from list”

You may run into a dead end if you want to use an operation that isn’t supported by a data structure (which probably means you imagined a completely different representation of the data in order to make that operation possible), when that happens you’ll need to either use different operations, or use a different data structure. You might also be taking something for granted and might need more operations to do what you meant than you first thought.
For example, lists cannot be changed, but if you put the characters in a list then you’re free to change the characters (preferably in-place because if you make the list resize a lot that would be very inefficient and you really mean to use a different data structure where that makes more sense to do, or use different operations, like writing the results to a new list where you’d just be appending instead of moving all the elements around each time something’s removed)


#4

Thanks to both of you! That is helpful. For now I think I’m going to push through and implement the strategies mentioned by ionatan.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.