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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read