Skip to content

1. Introduction

The PDF of this document is available |HERE|.

The exemples of this document are available |HERE|.

Here, we propose revisiting a problem presented in 2020 in the course [python3-flask-2020]. That course was based on a simplified tax calculation for the year 2019. A Python script was developed to solve the problem and then adapted into multiple versions (18) until the tax calculation was implemented in an MVC web application.

Here, we aim to demonstrate that the initial tax calculation script can now be generated by AI (Artificial Intelligence) tools. We used seven tools: ChatGPT, Grok, Gemini, MistralAI, DeepSeek, ClaudeAI, and Perplexity. There are others.

This document does not necessarily require knowledge of the Python language. The seven tools should generate a Python script that initially includes 11 unit tests, and eventually 25 tests. Simply load this code into a Python development environment, run it, and verify that the tests pass. The generated code can then be considered “likely correct.” Python users will take a closer look at the code and notice that the generated Python scripts are generally very well written.

Furthermore, this document shows that the AI tools used are fairly easy to use and that the interaction between the user (you) and the AI tool is no different from that between a teacher and a student.

This document was written in September 2025. AI is evolving rapidly, and it is possible that the screenshots below will quickly become obsolete. If you ask the same questions as in this document, it is very likely that you will get different answers than those provided here. Simply follow the process for refining your instructions, shown here, to help the AI.

You can download the code and files for this tutorial at: [Generate a Python script with AI tools]: