Skip to content

About

🐍 AI-Powered Python Tutor (Variables to Metaclasses, 50+ Interactive Exercises) built with Streamlit & Google Gemini API β€” by Robina Mirbahar

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

73 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐍 Python Learning Assistant

Author & Architect: Robina Mirbahar (Google Developer Expert in Cloud & AI)
Focus: Interactive AI-Powered Python Tutor (Variables to Metaclasses & 50+ Hands-On Exercises) with Streamlit & Google Gemini


🎯 Why I Built Python Learning Assistant (Engineering Purpose & Real-World Value)

1. 🐍 Personalized Socratic Mentorship Over Copy-Paste Answers

I built the Python Learning Assistant to guide learners from foundational syntax (variables, loops) to advanced software engineering (decorators, generators, metaclasses) using adaptive Socratic hints rather than just dumping solutions.

2. πŸ§ͺ 50+ Structured Coding Challenges with Live Feedback

I curated more than 50 progressive exercises where the Gemini-powered evaluator inspects AST structure, edge cases, and PEP 8 style in real time.

3. 🌱 Accessible Browser-First Learning Environment

By packaging the tutor in a clean Streamlit interface, students and workshop attendees can practice Python interactively from any laptop or tablet.


πŸ—οΈ System Architecture

flowchart TD
    subgraph UI ["1. Interactive Streamlit Learning Portal"]
        U_Mod["Curriculum Selector (Basics βž” OOP βž” Metaclasses)"]
        U_Code["Interactive Code Editor & 50+ Exercises"]
        U_Chat["Socratic AI Mentor Q&A"]
    end
    subgraph Tutor ["2. Gemini Pedagogical Evaluation Engine"]
        T_Check["Code Correctness & Edge-Case Grader"]
        T_Hint["Adaptive Hint & Concept Visualizer"]
        T_PEP["PEP 8 Idiomatic Style Coach"]
    end
    subgraph Progress ["3. Learner Mastery Tracking"]
        P_State["Session Progress & Skill Badges"]
    end
    U_Mod --> U_Code --> T_Check
    U_Chat --> T_Hint
    T_Check --> T_Hint & T_PEP --> P_State
Loading

Streamlit App License: MIT Python Gemini API PRs Welcome

An interactive AI-powered Python tutor β€” built for all skill levels.
Adaptive explanations. Live code examples. Instant feedback. Powered by Google Gemini.

🌐 Live Demo Β· πŸ› Report Bug Β· ✨ Request Feature

App Screenshot


✨ Features

Feature Description
🎯 Adaptive Learning Tailored explanations for beginner, intermediate, and advanced learners
πŸ’» Interactive Examples Run code snippets directly inside the app
πŸ“š 50+ Question Bank Pre-loaded with curated Python questions across all skill levels
⚑ Real-time Feedback Instant AI-driven explanations and corrections
πŸ—‚οΈ Session History Progress tracking that persists throughout your learning session

πŸš€ Quick Start

Prerequisites

Installation

# 1. Clone the repository
git clone https://github.com/yourusername/python-learning-assistant.git
cd python-learning-assistant

# 2. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate        # macOS / Linux
.\venv\Scripts\activate         # Windows

# 3. Install dependencies
pip install -r requirements.txt

# 4. Add your API key
echo "GEMINI_API_KEY=your_api_key_here" > .env

# 5. Launch the app
streamlit run python-assistant.py

Then open http://localhost:8501 in your browser. πŸŽ‰


πŸ“‚ Project Structure

PYTHON-LEARNING-ASSISTANT/
β”œβ”€β”€ .devcontainer/          # VSCode dev container configuration
β”œβ”€β”€ .github/                # GitHub Actions workflows
β”œβ”€β”€ venv/                   # Python virtual environment (gitignored)
β”œβ”€β”€ .env                    # Environment variables (gitignored)
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ python-assistant.py     # Main Streamlit application
β”œβ”€β”€ README.md
└── requirements.txt        # Python dependencies

πŸ“š Sample Questions

🟒 Beginner
  • "Explain variables and data types in Python"
  • "How do if-else statements work?"
  • "What are lists and how do I use them?"
🟑 Intermediate
  • "Explain OOP concepts with a class example"
  • "How do I handle file I/O operations?"
  • "What are decorators and when should I use them?"
πŸ”΄ Advanced
  • "Explain metaclasses with real-world use cases"
  • "How can I optimize Python code performance?"
  • "Implement a custom context manager"

πŸ› οΈ Development

Using the Dev Container (VSCode)

  1. Open the project folder in VSCode
  2. Press F1 β†’ select "Remote-Containers: Reopen in Container"
  3. The environment configures automatically β€” no manual setup needed

Dependencies (requirements.txt)

streamlit>=1.32.0
google-generativeai>=0.3.0
python-dotenv>=1.0.0

🀝 Contributing

Contributions are welcome and appreciated! Here's how to get started:

  1. Fork this repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Commit your changes: git commit -m 'feat: add your feature'
  4. Push to your branch: git push origin feature/your-feature-name
  5. Open a Pull Request

For major changes, please open an issue first to discuss what you'd like to change.


πŸ“œ License

Distributed under the MIT License. See LICENSE for details.


πŸ™ About the Author

Robina Mirbahar
πŸ† Google Cloud Innovator Champion Β |Β  πŸ‘©β€πŸ’» Women Techmakers Ambassador Β |Β  πŸš€ Google Developer Expert

LinkedIn Twitter GitHub

If you find this project useful, consider giving it a ⭐ β€” it helps others discover it too!


πŸš€ Featured Google Cloud & Agentic AI Portfolio by Robina Mirbahar

Repository Architecture & Focus Live Status
gemma4-multilora-adk-eval Dynamic Multi-LoRA Hot-Swapping & CI/CD Agent Evaluation (adk eval) on Cloud Run GPUs with Gemma 4 & vLLM Stars Last Commit
slothsre-napops SlothSRE ("NapOps") β€” Overnight Gemma 4 & Google ADK Incident Digest Agent with OpenTelemetry & Sentry AI Monitoring Stars Last Commit
streamforge-event-adk Real-Time Event-Driven Multi-Agent Pipelines on Google Cloud with ADK (ParallelAgent & LoopAgent), Eventarc & Pub/Sub Stars Last Commit
a2a-mcp-mesh-cloudrun Agent-to-Agent (A2A) & Multi-MCP Mesh on Cloud Run with Gemma 4, Google ADK, Spanner Graph & AlloyDB Stars Last Commit
cloudguard-gemma-agent 6-Part Production Gemma Enterprise Agent Series (ADK, Cloud Run L4 GPU, Firestore, Model Armor, Vertex AI QLoRA) Stars Last Commit
Comic-Studio-Ai Multi-Agent Comic Generator powered by Google Gemini API & FastAPI deployed on Google Cloud Run Stars Last Commit
vertex-ai-imagen3 Generate AI-powered product & editorial images using Google Vertex AI Imagen 3 in Google Colab Stars Last Commit
Python-Learning-Assistant AI-powered Python tutor covering 50+ interactive exercises with real-time feedback built with Streamlit + Gemini API Stars Last Commit
cozy-ai-agent-cafe-game Prompt Paws: 60 FPS Cozy AI Agent Bakery Simulation Game teaching RAG, Guardrails, Context Caching & Multi-Agent Loops Stars Last Commit
Robina Mirbahar Banner

πŸ‘©β€πŸ’» About the Author

Robina Mirbahar β€” Google Cloud & AI Architect
Google Developer Expert (GDE) in Cloud & AI β€’ Published Author β€’ Multi-Agent Systems & Serverless GPU Builder

GitHub Medium DEV.to LinkedIn GDE Profile YouTube X Amazon Author

About

🐍 AI-Powered Python Tutor (Variables to Metaclasses, 50+ Interactive Exercises) built with Streamlit & Google Gemini API β€” by Robina Mirbahar

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages