What Programming Languages Are Used in AI For Beginners? A Complete Code Breakdown

The Microsoft AI For Beginners repository uses Python as its primary language for all AI lessons and notebooks, with JavaScript (Vue 2) powering the interactive quiz application.

The AI For Beginners curriculum is Microsoft's open-source educational resource designed to teach artificial intelligence fundamentals through hands-on coding. The repository demonstrates machine learning concepts across neural networks, natural language processing, and computer vision—all implemented in Python with support from both TensorFlow and PyTorch. A secondary JavaScript codebase provides the quiz interface that helps learners test their understanding.

Core Programming Languages in AI For Beginners

The repository's codebase splits cleanly between two domains: AI experimentation and web-based interactivity.

Python: The Foundation of All AI Lessons

Every executable lesson, notebook, and example script in the AI For Beginners curriculum is written in Python. This deliberate choice aligns Python's readability with the educational mission, while leveraging its dominance in machine learning ecosystems.

The Python implementation spans three layers:

  • Pure Python examples – Standalone scripts that illustrate core algorithms without external dependencies
  • PyTorch notebooks – Interactive lessons demonstrating dynamic neural network construction
  • TensorFlow notebooks – Complementary implementations showing Google's framework

In examples/01-hello-ai-world.py, the repository provides a minimal entry point that implements gradient descent from scratch:

import random

class SimpleAILearner:
    def __init__(self):
        self.weight = random.uniform(0, 5)   # initial guess

        self.learning_rate = 0.01

    def predict(self, x):
        return self.weight * x

    def train(self, training_data, epochs=100):
        for epoch in range(epochs):
            for x, y_true in training_data:
                y_pred = self.predict(x)
                error = y_true - y_pred
                # simple gradient-descent update

                self.weight += self.learning_rate * error * x

if __name__ == "__main__":
    data = [(1, 2), (2, 4), (3, 6), (4, 8), (5, 10)]
    ai = SimpleAILearner()
    ai.train(data, epochs=100)
    print(f"Learned weight ≈ {ai.weight:.2f}")   # should approach 2.0

This script appears in the first lesson to demystify machine learning—learners see exactly how weights update without framework abstraction.

Framework-Specific Python Implementations

Beyond pure Python, the curriculum provides parallel implementations in both major deep-learning frameworks:

Framework Representative File Learning Focus
PyTorch lessons/3-NeuralNetworks/05-Frameworks/IntroPyTorch.ipynb Dynamic computation graphs, eager execution
TensorFlow/Keras lessons/5-NLP/18-Transformers/TransformersTF.ipynb Static graphs, high-level model APIs

These dual implementations let learners compare framework philosophies directly.

JavaScript (Vue 2): The Quiz Application

The repository's only non-Python programming language appears in etc/quiz-app/, where a Vue.js 2 single-page application delivers interactive assessments. Located at etc/quiz-app/src/components/Quiz.vue, the core quiz component combines template markup with JavaScript logic:

<template>
  <section class="quiz">
    <h2>{{ title }}</h2>
    <div v-if="!finished">
      <p v-html="currentQuestion.question"></p>
      <ul>
        <li v-for="(opt, idx) in currentQuestion.options" :key="idx">
          <label>
            <input type="radio" :value="opt" v-model="selected" />
            {{ opt }}
          </label>
        </li>
      </ul>
      <button @click="submitAnswer">Submit</button>
    </div>
    <div v-else>
      <p>Score: {{ score }} / {{ questions.length }}</p>
    </div>
  </section>
</template>

<script>
export default {
  name: "Quiz",
  props: { title: String, questions: Array },
  data() {
    return {
      index: 0,
      selected: null,
      score: 0,
      finished: false,
    };
  },
  computed: {
    currentQuestion() {
      return this.questions[this.index];
    },
  },
  methods: {
    submitAnswer() {
      if (this.selected === this.currentQuestion.answer) this.score++;
      this.selected = null;
      if (this.index + 1 < this.questions.length) this.index++;
      else this.finished = true;
    },
  },
};
</script>

<style scoped>
.quiz { max-width: 600px; margin: auto; }
</style>

The root component at etc/quiz-app/src/App.vue handles routing and application state, completing a standard Vue 2 architecture.

Key Source Files by Language

Understanding the repository structure clarifies how programming languages in AI For Beginners are distributed:

Path Language Purpose
examples/01-hello-ai-world.py Python Entry-level script demonstrating weight learning
lessons/3-NeuralNetworks/05-Frameworks/IntroPyTorch.ipynb Python (PyTorch) Neural network framework introduction
lessons/5-NLP/18-Transformers/TransformersTF.ipynb Python (TensorFlow) Transformer architecture with Keras
etc/quiz-app/src/App.vue JavaScript (Vue) Quiz application entry point
etc/quiz-app/src/components/Quiz.vue JavaScript (Vue) Interactive question logic
environment.yml YAML Dependency specification for conda environments

Supporting Technologies (Non-Programming Languages)

The repository includes configuration and markup files that support execution but are not programming languages:

  • Markdown – All lesson instructions and documentation
  • YAML – Environment specifications in environment.yml listing TensorFlow, PyTorch, Keras, and utility libraries
  • JSON – Quiz data files stored as static assets

Why This Language Selection Matters for Learners

The Python-first approach in AI For Beginners reflects industry standards—Python powers production machine learning at Google, Meta, OpenAI, and Microsoft itself. By providing both TensorFlow and PyTorch, the curriculum avoids framework lock-in, a common criticism of single-framework courses.

The Vue 2 quiz application, while secondary, demonstrates practical full-stack deployment: learners can extend or redeploy the quiz system, gaining exposure to JavaScript ecosystem tooling.

Summary

  • Python is the sole programming language for all AI and machine learning code in the repository
  • JavaScript (Vue 2) powers the supplementary quiz web application
  • The curriculum provides dual framework support through PyTorch and TensorFlow notebooks
  • Pure Python examples in examples/01-hello-ai-world.py teach fundamentals without abstraction
  • Key educational files include lessons/3-NeuralNetworks/05-Frameworks/IntroPyTorch.ipynb and lessons/5-NLP/18-Transformers/TransformersTF.ipynb

Frequently Asked Questions

Does AI For Beginners require knowing JavaScript?

No. JavaScript appears only in the optional quiz application at etc/quiz-app/. All core AI lessons, notebooks, and executable examples use Python exclusively. Learners can complete the entire curriculum without opening the Vue components.

Which Python deep-learning framework does the curriculum prioritize?

Neither. The repository provides parallel TensorFlow and PyTorch implementations for equivalent lessons, letting learners choose based on preference or workplace requirements. The environment.yml file includes dependencies for both frameworks.

Can I run the Python examples without installing frameworks?

Yes. The examples/01-hello-ai-world.py script uses only Python's standard library—specifically random—to demonstrate gradient descent. This intentional design removes barriers for absolute beginners before introducing external dependencies.

What version of Vue does the quiz application use?

The quiz application uses Vue 2, as evidenced by the Options API pattern (data(), computed, methods) in etc/quiz-app/src/components/Quiz.vue. The component structure follows Vue 2's single-file component conventions established before Vue 3's Composition API.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →