tag:blogger.com,1999:blog-7933794355391496434.post1831686563300690139..comments2023-06-03T06:26:18.614-06:00Comments on A Million Chimpanzees: My 19 Days of Python: Day 3 and I Hit a Walljames.pyleshttp://www.blogger.com/profile/11424800834517755783noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7933794355391496434.post-28123740118720742362012-09-14T08:39:00.699-06:002012-09-14T08:39:00.699-06:00Hi James, hang in there. :)
You can also check ou...Hi James, hang in there. :)<br /><br />You can also check out this interactive version of the book, http://interactivepython.org/courselib/static/thinkcspy/Functions/functions.html. You can run all the code directly off the page, modify a few parameters to experiment with, and see the results right away. if you choose to create an account, you can also save your code separately from the 'gold version'. A short video instruction is here, http://runestoneinteractive.org/. <br /><br />I, too, tried to learn how to write a few lines of code after a chosen profession many years after. I had given up multiple times and swing wildly between different languages over the years before settling on Python. The key for me between my failed attempt to finally learn some basics was to remind myself to have fun. Really, that was what it took. I learned to use a formal schedule as a guideline instead of feel like falling behind when I got stuck, I learned to purposely sidetrack myself when I see something fun and interesting I go off the topic to explore the topic and only come back to the book when I am ready. Also, whenever I see something I can apply to work, I do it right away and feel like I have 'done something' once I finish a small script or what not. Focusing on the benefit (help me do my job and have fun) instead of the feature (Python/Perl, functions, loops, String) kept me going and motivated. <br /><br />Cheers and thanks for sharing. It is not always easy to expose your weak moments, takes a confident person to do just that. :)<br /><br /><br />Eric Chou https://www.blogger.com/profile/11336226720003537549noreply@blogger.comtag:blogger.com,1999:blog-7933794355391496434.post-17747710835289207912012-09-13T17:13:22.089-06:002012-09-13T17:13:22.089-06:00James --
I too learned the basics of python by r...James -- <br /><br />I too learned the basics of python by reading Think Python and worked through these examples. I can tell you that when you first learn to program it can be very intimidating! Stick with it! The more you try and apply previously learned concepts, the more you understand them! If you think you are more of an auditory/visual learner as opposed to a textual learner, I suggest you check out CS101 at udacity ( http://www.udacity.com/overview/Course/cs101/CourseRev/apr2012 ). However I would still very much recommend you keep reading Think Python because it covers a lot of important information and thinking strategies that udacity skips over. I hope you keep continuing with your 19 days of Think Python. Everyone runs into mistakes and blocks when learning to program, it's just part of how one learns. Anonymoushttps://www.blogger.com/profile/17981231357423505560noreply@blogger.comtag:blogger.com,1999:blog-7933794355391496434.post-33402282433357810772012-09-11T19:18:29.903-06:002012-09-11T19:18:29.903-06:00Hi James. I have been holding off on commenting b...Hi James. I have been holding off on commenting because I don't want to ruin your experiment. But your articles are incredibly helpful for me.<br />I see a lot of places where I can make improvements in the book based on where you are having problems.<br /><br />The particular error you posted is a good one. It looks like this is the line of code that's failing:<br /><br />do_four(print_twice('spam'))<br /><br />This is a nested function call, so the inner one happens first. print_twice prints 'spam' twice and then returns None. So the value that gets passed to do_four is None. But the value passed to do_four needs to be a function, so if you give it None, it fails.<br /><br />The exercise says that do_four should take two parameters, a function object and a value, so when you call it, it should look like this:<br /><br />do_four(print_twice, 'spam')<br /><br />I will leave you to write the definition for do_four.<br /><br />By the way, I really like your idea of reading the book once away from the computer before you sit down to program. It sounds like you are doing everything right.<br /><br />Hang in there; I think you will find Chapter 4 more fun.Allen Downeyhttps://www.blogger.com/profile/01633071333405221858noreply@blogger.com