This is a chance for you to write exercises for ReadingBat! If you're just starting your Python journey, stick with topics we've covered already. If you have studied Python before, feel free to write exercises for anything you want (in Python, of course).
- A template file (RBtemplate.py) is included for you. Your exercise should have the same format. Feel free to copy and paste from the template into my_code.py
- The first line (@some text) is called a decorator. Use that to put a short description for the end user.
- Yes, you need the comment symbol in front of it.
- You will have 2 functions to write.
- Function 1 is the one the user will see. Change the name and what it does and returns.
- Function 2 contains the cases you want the user to address. In the print statements, call your function and give it whatever arguments you want. Don't change the name of this one - it needs to be called
main
.
- Run your code and make sure it runs correctly.
- After you have tested your exercise yourself, you can decide if you want to test it using pytest or on ReadingBat. See Megan for help with either.
- To test with pytest, you will modify the my_test.py file.
- To test on ReadingBat, we'll run it in a simulated website to be sure everything works. (This requires a bit more time.)
Questions? Just ask!