Recently, a friend who was getting started with Python asked me to check some code she had been working with. She was building a tool to assess the impact of artificial intelligence on small businesses in a particular geographic area. She was using AI to teach herself Python. I love learning, and my friend’s request invited me to rethink how I teach Python. I have recently been using VSCodium, which is identical to Microsoft’s Visual Studio Code and is open source. There is a lot of pushback on AI, including concerns about its threat to learning and the code it generates.
Rather than implementing a ban on AI, we should utilize it as a “tutor on demand.” Can we use AI as a Socratic assistant when instructing students in Python programming? Encourage students to ask questions like “Why is this loop not working?” instead of simply saying “Fix this code.” This approach encourages a deeper engagement with the underlying logic. Teach students how to evaluate their own code critically.
It’s important to highlight that generative AI does not inherently guarantee correctness and can often introduce subtle logical or performance issues. One of the strengths of AI and coding is quickly and easily illustrating to students that there are multiple ways to accomplish the same or similar goals, such as drawing a circle. One day, while using an AI agent, I entered: “draw a circle with Python.” I was thinking of the turtle module, but instead, the AI program gave me code that used the matplotlib library. I don’t think I would have ever thought of that iteration on my own.
import matplotlib.pyplot as plt
# Create a figure and an axis
fig, ax = plt.subplots()
# Create a circle patch (Center: x=0, y=0, Radius=5)
circle = plt.Circle((0, 0), 5, color='blue', fill=False, linewidth=2)
# Add the circle to the axis
ax.add_patch(circle)
# Set equal scaling so the circle is not distorted into an oval
ax.set_aspect('equal', adjustable='datalim')
# Automatically scale the plot limits to show the circle
ax.autoscale_view()
# Display the plot
plt.title("Circle using Matplotlib")
plt.grid(True)
plt.show()

Making programming easier for students also makes it more appealing to them. Learning should be fun, and the combination of AI with open-source tools like VSCodium, Thonny, or Mu ensures that students not only learn effectively but also enjoy the process.
In conclusion, the integration of AI into Python programming instruction represents a significant evolution in educational methods. By leveraging open-source tools like VSCodium, Mu, and Thonny, educators can create an engaging and effective learning environment that fosters curiosity and critical thinking. Rather than viewing AI as a threat, we should embrace its potential to enhance our teaching practices and encourage students to explore concepts deeply and independently. As we navigate this exciting landscape, the goal should remain clear: to make learning enjoyable and accessible, ensuring that the next generation of programmers is not only skilled but also inspired to innovate. Through collaborative exploration and the smart use of technology, we can cultivate a community of learners ready to tackle the challenges of tomorrow.