We present small code samples that have errors in them. Initially, there is only one error and it is relatively easy to spot. As we move up challenges, there are multiple errors and subtle bugs.
By working through these examples, we hope you get better at:
- reading errors
- debugging
- reading and editing other people's code
- Googling for specific issues
- solving errors on your own
We noticed that people learning new programming languages lack some foundational skills like the ability to read errors, the knowledge to self-correct their own mistakes, the skill to limit their attention to only the relevant lines of code, etc. This repository is a collection of simple errors that beginners are likely to hit when they start to write Python code. Our idea is to present exercises in which beginners can experience errors and try to solve them on their own.
This repository has been created and maintained by Qxf2 Services. Qxf2 provides QA consultancy services for startups. If you found this repository useful, please let us know by giving us a star on GitHub.
We suggest you do the following
-
Fork this repository
-
In your terminal prompt (git bash, command prompt, etc.), navigate to each challenge directory (e.g.:
01_challenge
) -
Run the one Python script in the challenge directory (
python 01_challenge.py
) -
It should throw an error that reads similar to the
.png
in the challenge directory -
Fix the error and rerun
-
If all goes good, you should see the output of running fizz buzz
-
Once you fix the issue, update the readme file in the challenge directory (
01_readme.md
) with:a. what part of the error message gave you a clue
b. how you set about solving the issue (e.g.: I Googled
XXXX
that didn't help me narrow down my problem. After that, I tried GooglingPython XXXX
and finally ended up Googling forPython XXXX error
. Then I found a page that looked promising becauseYYYY
. Much thanks to reddit user /u/danielsgriffin for this tip!)c. summarize what you learned.
-
Don't forget to commit your fixed code and updated readme
-
Pro tip: Once you are setup, try your best to timebox each exercise to no more than 10-minutes. We recommend this tip for even rank beginners who know nearly nothing about Python!
NOTE: To get the most out of these exercises, we think beginners should use an IDE (e.g.: Visual Studio Code), use git and use one git branch per challenge. These are peripheral habits to the main exercises but they will go a long way in making you more comfortable in working with code.