Skip to main content

Section 4.10 Embracing the Journey

As we wrap up this section that deals with handling errors and verifying our solutions work it is important to know that learning to code can be hard at times and sometimes frustrating. However, the feeling you get when your code works is incredible! And your brain grows as you problem solve and debug your programs. Embrace those moments. Pause and think of why things actually went from problematic to working and doing what you want it to do.
Watch this short video about Growing your Mind:
To practice using a growth mindset, if you find yourself saying or thinking what’s in the left column, try substituting what’s in the right column instead:
Table 4.10.1. A simple table
Instead of: Try Thinking/Saying:
I’m not good at this. I can learn to do this.
I’m awesome at this. I’m on the right track.
I give up I’ll use a different learning strategy
This is too hard. This may take some time and effort.
I can’t make this any better. I can improve it!
I just can’t do programming. I’m going to train my brain to do this.
Plan A didn’t work. Let’s try something else.
It’s good enough. How can I improve this?
    How much do your agree with this statement:
    Your intelligence is something very basic about you that you can’t change very much.
  • 1.
    Strongly Agree.
  • 2.
    Agree
  • 3.
    Disagree
  • 4.
    Strongly Disagree

Subsection 4.10.1 Debugging Tips

Here are some practical tips to help you effectively debug your code, avoid and overcome errors:
  • Make sure you take the time to understand error messages. They can help you a lot.
  • print statements are your friends. Use them to help you uncover what is really happening in your code.
  • Work backward from the error. Many times an error message is caused by something that has happened before it in the program. Always remember that python evaluates a program top to bottom.
  • Simplify complex problems by breaking them into smaller, more manageable parts.
  • Don’t hesitate to ask for help from peers, online communities, or mentors. A fresh perspective can often spot issues you might overlook.
  • Take breaks if you feel frustrated. A clear mind can make problem-solving much easier.
  • Each error is an opportunity to learn. Take note of what caused the error and how you resolved it for future reference.
You have attempted of activities on this page.