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

Why AI Coding Tools Are Overrated: Debunking Common Misconceptions

Why AI Coding Tools Are Overrated: Debunking Common Misconceptions As a solo founder or indie hacker, you’ve probably heard the buzz around AI coding tools. The promise is enticing

Aug 30, 20263 min read
Ai Coding Tools

How to Build a Simple App with AI Tools in Just 3 Hours

How to Build a Simple App with AI Tools in Just 3 Hours Building an app might sound like a daunting task, especially if you're a solo founder or indie hacker. But what if I told yo

Aug 30, 20265 min read
Ai Coding Tools

How to Build Your First Application Using AI Coding Tools in Just 30 Days

How to Build Your First Application Using AI Coding Tools in Just 30 Days If you've ever felt overwhelmed by the prospect of building your first application, you're not alone. The

Aug 30, 20264 min read
Ai Coding Tools

Why AI Coding Tools Are Overrated: 5 Myths Busted in 2026

Why AI Coding Tools Are Overrated: 5 Myths Busted in 2026 As a solo founder or indie hacker, you’ve likely heard the hype surrounding AI coding tools. The promises of faster coding

Aug 30, 20264 min read
Ai Coding Tools

How to Boost Your Coding Skills Using AI: 30-Minute Daily Routine

How to Boost Your Coding Skills Using AI: 30Minute Daily Routine If you're an indie hacker or a solo founder, you know the importance of sharpening your coding skills. But who has

Aug 30, 20264 min read
Ai Coding Tools

Why GitHub Copilot is Overrated: A Honest Review

Why GitHub Copilot is Overrated: An Honest Review As a solo founder or indie hacker, you’re likely on the lookout for tools that genuinely save you time and effort. When GitHub Cop

Aug 30, 20264 min read