top of page

03.15.2018: One Lesson of Python

Today's soundtrack is Soen: Cognitive.

I'm on to the "Hacks and Tweaks" section of Coding Projects in Python's "Robot Builder" chapter.

The section starts by suggesting colours that Python's turtle module recognizes: lawn green, seashell, blue, purple, light blue, yellow, goldenrod, hot pink, thistle, gold, peru, forest green, maroon, navy, peach puff, misty rose, deep pink, lemon chiffon, and aquamarine. I used some of these colours to liven up my robot's palette.

Next, I made the robot look like he was rolling his eyes by changing the position of the eyes, and made the mouth lopsided.

After giving my robot his new silly expression, I gave him hands as directed by the book, and created a function to make arms. I was able to use the heading to rotate the arms as desired, but ran into a problem: the arms both curved to the right, making the robot asymetrical. So I created a new arm function for the right arm, copied and reversed the original arm coding, and set it in motion: it worked!


bottom of page