Ai Coding Tools

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

By BTW Team3 min read

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

If you’re a beginner trying to dive into coding, the sheer volume of resources and tools can be overwhelming. You might find yourself spending more time sifting through tutorials than actually writing code. Enter GitHub Copilot — a tool that leverages AI to help you code faster. In this guide, I’ll show you how to use GitHub Copilot to write your first program in under 2 hours. Yes, really.

What You Need to Get Started

Prerequisites

  1. GitHub Account: You’ll need to create a GitHub account if you don’t have one already.
  2. Visual Studio Code (VS Code): Download and install VS Code, the code editor we'll use.
  3. GitHub Copilot Subscription: GitHub Copilot is $10/month after a free trial. Make sure you have a subscription or at least access to the trial.
  4. Basic Understanding of Programming Concepts: Familiarity with variables, loops, and functions will help, but I’ll guide you through the basics.

Step-by-Step Guide to Writing Your First Program

Step 1: Install GitHub Copilot in VS Code

  • Open VS Code.
  • Go to the Extensions view by clicking on the Extensions icon in the sidebar or pressing Ctrl+Shift+X.
  • Search for “GitHub Copilot” and click Install.
  • Once installed, sign in with your GitHub credentials.

Step 2: Create a New File

  • Create a new file in VS Code and name it hello_world.py. This will be our first program.
  • As you start typing, GitHub Copilot will suggest code snippets based on what you write.

Step 3: Write Your First Code

  • Start by typing a comment: # This program prints Hello, World!
  • Then type print( and notice how Copilot suggests completing the line. Accept the suggestion by pressing Tab.

Expected Output:

# This program prints Hello, World!
print("Hello, World!")

Step 4: Run Your Code

  • Open a terminal in VS Code (`Ctrl + ``).
  • Type python hello_world.py and hit Enter.
  • You should see Hello, World! printed in the terminal.

Step 5: Experiment with Copilot

  • Now, let's add some functionality. Type a comment like # Calculate the sum of two numbers and then start typing the code.
  • Watch how Copilot suggests the complete function. For example:

Expected Output:

# Calculate the sum of two numbers
def sum(a, b):
    return a + b

result = sum(5, 3)
print(result)

Step 6: Troubleshooting Common Issues

  • Error Messages: If you encounter errors, check your syntax. Copilot is not perfect and may suggest incorrect code.
  • No Suggestions: If Copilot isn't suggesting anything, try typing a more specific comment or function name.

What's Next?

Once you’ve completed your first program, try building upon it. Add more functions, or even try creating a simple calculator. The possibilities are endless!

Pricing Breakdown

| Tool | Pricing | Best For | Limitations | Our Take | |--------------------|----------------------|---------------------------|----------------------------------|----------------------------------------| | GitHub Copilot | $10/mo, free trial | Beginner coding assistance | Not always accurate suggestions | We use it for rapid prototyping. | | Visual Studio Code | Free | General coding | Requires extensions for advanced features | Our go-to code editor. | | Python | Free | Scripting and automation | Performance can lag on large tasks | Essential for beginners. |

Conclusion: Start Here

If you're looking to write your first program quickly, GitHub Copilot is a great tool to have in your arsenal. It reduces the friction of writing code and helps you focus on learning. Remember, the key is to experiment and not be afraid to make mistakes.

So, grab your GitHub account, install VS Code, and get started with GitHub Copilot today. You’ll be shipping your first program in less than 2 hours!

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 Create Your First AI-Assisted Python Project in Under 2 Hours

How to Create Your First AIAssisted Python Project in Under 2 Hours If you’re a solo founder or indie hacker looking to dip your toes into AI without getting bogged down by complex

May 16, 20264 min read
Ai Coding Tools

How to Solve Common Coding Problems with AI in 30 Minutes

How to Solve Common Coding Problems with AI in 2026 As a solo founder or indie hacker, you know that coding problems can be real timesuckers. You might spend hours debugging or sea

May 16, 20264 min read
Ai Coding Tools

Top 7 AI Coding Tools for Expert Developers: A 2026 Review

Top 7 AI Coding Tools for Expert Developers: A 2026 Review As expert developers, we often find ourselves juggling multiple tasks—writing code, debugging, optimizing performance, an

May 16, 20265 min read
Ai Coding Tools

AI Code Generators vs. Traditional IDEs: What You Need to Know

AI Code Generators vs. Traditional IDEs: What You Need to Know (2026) If you're a developer in 2026, you're probably feeling the pressure to keep up with rapidly evolving tools and

May 16, 20264 min read
Ai Coding Tools

How to Debug with AI Tools in Just 30 Minutes

How to Debug with AI Tools in Just 30 Minutes Debugging can feel like searching for a needle in a haystack—especially when you're on a tight deadline or trying to ship a product. A

May 16, 20264 min read
Ai Coding Tools

How to Integrate AI Coding Tools in Your Daily Workflow in Just 30 Minutes

How to Integrate AI Coding Tools in Your Daily Workflow in Just 30 Minutes As a solo founder or indie hacker, time is your most precious resource. You want to code efficiently with

May 16, 20264 min read