Solving a Bite Exercise
Follow these instructions to solve the Bites (exercises) on the Pybites Platform.

Bite Exercise Instructions
On the left side of the screen is the description panel.
This contains the detail of the Bite exercise you need to code a solution to in the code editor on the right.
You'll notice that the descriptions on the Newbie Bites are incredibly detailed. This is by design as these are intended for absolute beginners.
As you progress through the difficulty levels on the platform, the number of hints we give you decreases. The guidance is still there, but you'll be expected to think up solutions with less of a walkthrough from us.
Please note the scroll bar on the description window. Some descriptions are lengthy, especially in the Newbie Bites, and will require you to scroll down to read the full description.
Using the Editor
The first thing you'll notice with the editor is that it generally doesn't start empty.
On many of the Bites we include template code. This is code that will help you structure your code response.
To write your code, simply write the Python code into the editor as you would if you were coding on your own system. It's no different.
Testing your Code
To test whether your code solves the exercise, we've created a series of tests.
Once you've written your code, you'll need to run our tests against your code to see whether you've been successful.
To do this, click the blue Run Tests button at the bottom of the coding editor.

Reading the Test Output
After clicking Run Tests you'll see the test results appear at the bottom of the screen.
If the tests pass, the results window will be Green. If the tests fail, the results window will be Red.
Don't be put off by the perceived complexity of the test output. Check out this article for a walkthrough on interpreting the pytest output
Tests Successful Window
The passing of the tests means you successfully solved the Bite. Congratulations!
From here, click the Next button at the top right of the screen to proceed to the next Bite in the list. Alternatively, head back to one of the Bite lists in the Exercises menu and choose your next challenge.

Test Failure Window
When the tests fail you'll see a window with output similar to the following screenshot. It will have the header "Oops, try again ..." and then print the pytest output indicating where your code failed.
Again, don't be intimidated by the output. It looks complex, but all you're looking for is the output indicating what part of your code failed the test. The failure output line you want to look for generally starts with an E indicating an Error. For a deeper dive into reading pytest output, please read this article.
After reading the error, head back to your code and make the adjustments you feel are necessary to fix it so it passes the tests.
Repeat the process of running the tests against your code until they pass, and move onto the next Bite.

Workflow for Solving a Bite
Last updated