There are several Single Board Computers (SBCs) that run Linux. SBCs can be inexpensive, however, you will may need to purchase an USB cable, keyboard, mouse, a battery pack (power supply), a SD card, or other hardware.
Note: The extra hardware for the SBC may be laying around. Ask around (friend, instructors, etc.)
Some examples of SBCs are:
Note: Python is part of most Linux installations. I have never seen one without Python, but there may be one out there.
Look at the projects for the ESP32 ( Program an ESP32 Micro-controller Using Python).
Modified them as required and do the projects on an SBC.
a. The total cost of the SBC hardware.
b. Installing Linux will take several steps (time and learning).
c. There is a learning curve for Linux (but not a difficult one).
d. Doing one of the other projects instead of the ESP32 ones.
e.
The Best Single-Board Computers of 2022