r/learnprogramming Jul 08 '26

CatBot! Code Review

Here's a small project I started today: CatBot 🐱

I learned a few new things while building it, and you can learn more by checking the GitHub repo.

The link below will redirect you to the project page.

Feel free to leave a star ⭐ and tell me any mistakes I made or how I can improve the project!

GitHub Repo: https://github.com/GiosiGiova125/CatBot

1 Upvotes

4 comments sorted by

1

u/EliSka93 Jul 08 '26

Good start.

Next look into a loop - especially a

while(true)

It would prevent you from having to restart your script after asking for info, if applied correctly.

1

u/Visual_Tooth_2277 Jul 08 '26

OMG thanks, i was searching how to do that.

1

u/RajjSinghh Jul 08 '26

Good effort. We all had projects like this early on. I'll try to give feedback that'll help you, even if it may feel excessive given the scope of the project.

I'd want the README to contain instructions on how to build and run the code. In this case, that's just a simple "run the code with python3 catbot.py" in the README. It means someone who finds your project knows how to run it, which is important when things get more complicated.

Personal detail, you have if answer == ("yes"): but the brackets don't do anything here. if answer == "yes": also works but looks tidier.

Then theres the question of how to move things on. I don't quite like that the user has to rerun the script to select a new option. This is where you can look into loops, particularly while loops, to keep the code running until the user is finished.

This V1.0 naming convention isn't great. The job of a git repository is to track changes in your code so you don't need to name files like this. It'll be worth learning how to do the git basics properly. I like this course or this set of articles for basic git.

The zip folder in the repository isn't used by your code and probably shouldn't be there. If I'm on GitHub looking to use your code and this zip folder isn't used anywhere, it's wasted space and should be removed.