Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Python Code MentorNew to Visual Studio Code? Get it now.
Python Code Mentor

Python Code Mentor

karaniph

|
1 install
| (0) | Free
AI-powered Python learning assistant with code explanations, quizzes, and progress tracking
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Python Code Mentor 🐍

AI-powered Python coding assistant that teaches understanding, not just copy-pasting.

This extension uses Google's Gemini AI to explain code logic, trace execution, identifying conceptual gaps, and more. It is designed specifically for beginners and learners.

Note: You must provide your own Google Gemini API key to use this extension.

🚀 Features

📘 Explain Code (Ctrl+Shift+E)

Select any Python code and get a beginner-friendly explanation of what it does, how it works, and why.

🔍 Trace Code Execution (Ctrl+Shift+T)

Visualize your code running step-by-step with sample input values. See exactly how variables change inside loops.

🆚 Compare Approaches (Ctrl+Shift+C)

Not sure if you should use a for loop or list comprehension? Type two versions and get a conceptual comparison of pros/cons (without being told "this one is better").

🧠 Analyze Logic (Ctrl+Shift+L)

Get feedback on your code's logic. Learn mental models to understand flow control and data structures better.

🧪 Interactive Quiz (Ctrl+Shift+Q)

Test your knowledge! Generate instant multiple-choice and fill-in-the-blank quizzes based on your own code.

📚 Snippet Library

Save your favorite explanations as "flashcards" in the sidebar to review later. Export them to JSON or Anki.

📊 Progress Tracking

Track your learning streaks and get weekly AI-generated insights about your learning patterns.

💎 Freemium & Pro

To cover development costs, the extension operates on a fair Freemium model:

  • Free Tier: 20 AI requests per day.
  • Pro Tier: One-time payment ($9.99) for Unlimited Access.

Upgrade to Pro to unlock unlimited learning.

⚙️ Setup

1. Get a Gemini API Key

  1. Go to Google AI Studio.
  2. Create a free API key.

2. Configure Extension

  1. Install the extension.
  2. Press Ctrl+, to open Settings.
  3. Search for Python Code Mentor.
  4. Paste your API key into the Gemini Api Key field.

Security Note: Your API Key is stored locally in VS Code settings. It is never sent to our servers.

3. Change AI Model (Using Newer Models)

The extension relies on your Google AI Studio API key. Recommended Models (free tier compatible):

  • gemini-2.5-flash (Default - Fast & Reliable)
  • gemini-2.5-latest

How to switch:

  1. Open Settings (Ctrl+,).
  2. Search "Code Mentor Model".
  3. Enter the model ID (e.g., gemini-2.5-pro if you have a paid account).

Note: Gemini 1.5 is deprecated. Please use 2.5 series or newer.

❓ Troubleshooting

Error: [404 Not Found] models/gemini... is not found

  • Cause: The default model version might not be available in your region or for your API key tier.
  • Fix: Go to Settings and change Model Name to gemini-pro (older but widely available) or checks Google's Model List.

📞 Support & Contact

Feedback? Questions? Feature requests?

  • X (Twitter): @karaniph
  • Issues: Please report bugs on the Marketplace page.

Happy Coding! 🐍

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft