- What’s a lightbulb that has gone on for you? Give an example.
The function can help me reduce the redundant code when I was trying to use Turtle to draw some shapes. I found that I could wrap the statement into a function so that I did not need to copy and paste the same statement for drawing several shapes.
Here is the old version
Here is the refactoring version
The function can make my code shorter and easier to read.
- Describe some confusion you’ve experienced. Did it help you learn?
In the beginning, I felt confused about whether the turtle moved with a trajectory or not. After discussion with my group mate, I found that there are two functions penup() and pendown() to control that.
- What’s still fuzzy for you? What will you do to make sure you can resolve your fuzziness?
I sometimes experienced indentation errors, and I realized that was because I mixed the tab and spaces. What I learned to solve this issue is consistently using spaces.
- What problem solving strategies have been working for you? Give an example.
I will break down the problem. For example, in the exercise of the textbook, there is an over speed question. In that question, we have to design a program that can determine the fine for over speed. Moreover, if is_birthday, the driver can have more 5 miles for over speed. What I did was focus on the normal situation (is_birthday = False) and then deal with the special condition (is_birthday = True)