I would suggest typing it out in lieu of straight copy/paste. This exercises your muscle memory with the new stuff you're learning, and makes you pay attention to the details when it's not new stuff.
I find that "thoughtfully typing" it is the ideal solution.
In other words, using your own function/variable names, refactoring to use functional methods like .map instead of for loops, etc.
By the time you reach the end, you almost always understand how it works.
Just wanted to say this is good advice, and basically the approach of Zed Shaw in his book Learn Python the Hard Way.
If you want to take the muscle memory to the next level, delete the code after you've typed it out, and then try to write it out from memory. It's kind of an ad hoc test of yourself, and that is one of the absolute best ways to learn.
I would suggest typing it out in lieu of straight copy/paste. This exercises your muscle memory with the new stuff you're learning, and makes you pay attention to the details when it's not new stuff.
I find that "thoughtfully typing" it is the ideal solution.
In other words, using your own function/variable names, refactoring to use functional methods like
.map
instead offor
loops, etc.By the time you reach the end, you almost always understand how it works.
Just wanted to say this is good advice, and basically the approach of Zed Shaw in his book Learn Python the Hard Way.
If you want to take the muscle memory to the next level, delete the code after you've typed it out, and then try to write it out from memory. It's kind of an ad hoc test of yourself, and that is one of the absolute best ways to learn.
psychologytoday.com/us/blog/ulteri...