Ai Coding Tools

How to Use GitHub Copilot to Write Your First Python Program in 2 Hours

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First Python Program in 2026

If you’re a beginner looking to start programming in Python, you might feel overwhelmed by the thought of writing your first program. But what if I told you that AI can help you get started in just two hours? GitHub Copilot is a tool that pairs with your code editor to suggest code snippets, making the process a lot easier. In this guide, I’ll walk you through using GitHub Copilot to write your first Python program, sharing my experience and some honest trade-offs along the way.

Time Estimate: 2 Hours

Before we dive in, you should expect to spend around two hours setting everything up and writing your first program. This includes installing necessary tools, getting familiar with GitHub Copilot, and actually coding.

Prerequisites

  1. GitHub Account: Create a free account if you don’t have one.
  2. Code Editor: Install Visual Studio Code (VS Code) or any code editor that supports GitHub Copilot. VS Code is free and widely used.
  3. GitHub Copilot Subscription: Copilot costs $10/month or $100/year after a free trial period.

Step-by-Step Guide

Step 1: Install GitHub Copilot

  1. Open Visual Studio Code.
  2. Go to the Extensions view by clicking on the square icon on the sidebar or pressing Ctrl+Shift+X.
  3. Search for "GitHub Copilot" and click "Install".
  4. After installation, sign in with your GitHub account.

Step 2: Create a New Python File

  1. In VS Code, create a new file by clicking on File > New File.
  2. Save it as hello.py.

Step 3: Start Coding

  1. In the hello.py file, type print("Hello, World!").
  2. As you type, GitHub Copilot will suggest code completions. You can accept suggestions by pressing Tab.

Expected Output: When you run the program, you should see:

Hello, World!

Step 4: Build a Simple Function

Now, let’s create a simple function that adds two numbers:

  1. Type def add_numbers(a, b): and wait for Copilot to suggest the function body.
  2. Accept the suggestion that returns the sum of a and b.

Expected Output: You can test the function by calling it:

result = add_numbers(3, 5)
print(result)  # This should output 8

Troubleshooting

If GitHub Copilot doesn’t suggest any code, make sure:

  • You are connected to the internet.
  • You’ve signed into your GitHub account in VS Code.
  • Check if the GitHub Copilot extension is enabled.

What's Next?

After you’ve successfully written your first program, consider exploring more complex Python projects. You might want to try building a simple web app using Flask or a data analysis project using Pandas.

Limitations of GitHub Copilot

While GitHub Copilot is a powerful tool, it has its limitations:

  • Not Always Accurate: Sometimes the suggestions can be incorrect or not optimal.
  • Dependency on Internet: You need an active internet connection for it to work.
  • Learning Dependency: Relying too much on suggestions may hinder your learning process.

Conclusion: Start Here

If you’re a beginner looking to write your first Python program, GitHub Copilot is a great tool to get you started quickly. Just remember to check your code and understand what it’s doing—don’t let the AI do all the heavy lifting.

In our experience, GitHub Copilot works well for getting quick suggestions, but it’s essential to learn the fundamentals of Python to become a proficient coder.

What We Actually Use

For coding projects, we mostly rely on GitHub Copilot for suggestions but also emphasize the importance of understanding the code we write. It’s a great supplement but not a replacement for learning.

Follow Our Building Journey

Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.

Subscribe

Never miss an episode

Subscribe to Built This Week for weekly insights on AI tools, product building, and startup lessons from Ryz Labs.

Subscribe
Ai Coding Tools

How to Automate Your Development Workflow with AI in 3 Easy Steps

How to Automate Your Development Workflow with AI in 3 Easy Steps (2026) As indie hackers and solo founders, we often find ourselves buried under a mountain of repetitive tasks tha

Sep 3, 20264 min read
Ai Coding Tools

How to Boost Your Coding Velocity with AI in 30 Minutes

How to Boost Your Coding Velocity with AI in 30 Minutes As a solo founder or indie hacker, you know that time is your most precious resource. The idea of boosting your coding veloc

Sep 3, 20264 min read
Ai Coding Tools

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted

Why Most Developers Get GitHub Copilot Wrong: 5 Myths Busted As we dive into 2026, GitHub Copilot has become a staple in many developers' toolkits. However, despite its popularity,

Sep 3, 20263 min read
Ai Coding Tools

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours

How to Use AI Coding Tools to Boost Productivity in Under 2 Hours As indie hackers, we all know the struggle of trying to stay productive while juggling multiple projects. The prom

Sep 3, 20265 min read
Ai Coding Tools

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project?

Vercel vs GitHub Copilot: Which AI Tool is Right for Your Project? As a solo founder or indie hacker, choosing the right tools can be a makeorbreak decision for your project. With

Sep 3, 20263 min read
Ai Coding Tools

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths

Why GitHub Copilot is Not the Magic Bullet for Every Programmer: Debunking the Myths As a programmer, I’ve been there: staring at a blank screen, hoping for a burst of inspiration

Sep 3, 20264 min read