Ai Coding Tools

How to Use GitHub Copilot to Write Your First 100 Lines of Code in Under 30 Minutes

By BTW Team4 min read

Comparing tools? See the AI tools tested on the show.

In short

A step-by-step tutorial on utilizing GitHub Copilot effectively to rapidly write your initial code lines and boost your productivity.

If you’re new to coding, diving into the world of programming can feel overwhelming. You might think, “Can I really write code that works?” The good news is that with tools like GitHub Copilot, you can get started quickly and effectively. In this guide, I’ll show you how to leverage Copilot to write your first 100 lines of code in under 30 minutes.

Prerequisites: What You Need to Get Started

Before we jump in, let’s cover what you need:

  • A GitHub account: Sign up for free if you don’t have one.
  • Visual Studio Code (VS Code): Download and install it. It’s a popular code editor.
  • GitHub Copilot: You’ll need to subscribe to GitHub Copilot. Pricing starts at $10/month after a free trial.
  • Basic understanding of programming concepts: Familiarity with variables, loops, and functions will help, but it’s not mandatory.

Step 1: Set Up GitHub Copilot in VS Code

  1. Install the GitHub Copilot extension: Open VS Code, go to the Extensions view (Ctrl+Shift+X), and search for "GitHub Copilot". Click on "Install".
  2. Sign in to GitHub: After installation, you’ll be prompted to log into your GitHub account. Follow the authentication steps.
  3. Start a new file: Create a new file in a programming language of your choice (e.g., Python, JavaScript).

Step 2: Write Your First Line of Code

Now, let’s write some code. Start with a simple task, like printing "Hello, World!".

  1. Type print("Hello, World!") and wait for Copilot's suggestion.
  2. If you see the suggestion pop up, you can accept it by hitting the Tab key.

Expected Output:

You should see "Hello, World!" printed in your console when you run the code.

Step 3: Build on Your Code with Copilot

Now that you’ve got your first line, let’s expand. Here’s how to write a simple function that adds two numbers:

  1. Type def add_numbers(a, b): and give Copilot a moment to suggest the function body.

  2. Accept the suggestion, which might look something like this:

    return a + b
    
  3. Next, call your function and print the result:

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

Expected Output:

You should see 8 printed in your console.

Step 4: Create a Simple Loop

Let’s add some complexity with a loop. Type the following code to create a list of numbers and print them:

  1. Start with:
    for i in range(5):
    
  2. Let Copilot suggest the body of the loop, which might be:
    print(i)
    

Expected Output:

You should see the numbers 0 through 4 printed, one per line.

Troubleshooting: What Could Go Wrong

  • No suggestions appearing: Ensure that you’re connected to the internet and that GitHub Copilot is enabled in your settings.
  • Errors in code: If your code doesn’t run, double-check the syntax. Copilot is helpful, but it’s not infallible.

What's Next: Expanding Your Skills

After you’ve written your first 100 lines, consider the following:

  • Explore more complex functions: Try writing functions that handle lists, dictionaries, or even classes.
  • Get familiar with debugging: Learn how to read error messages and fix issues in your code.
  • Join coding communities: Platforms like GitHub, Stack Overflow, and Reddit can provide support and resources.

Conclusion: Start Here

Using GitHub Copilot can significantly speed up your coding journey. By following these steps, you should be able to write your first 100 lines of code in under 30 minutes. Remember, the key is to keep practicing and exploring new coding challenges.

What We Actually Use

We’ve found that GitHub Copilot is a great tool for beginners and even seasoned developers looking for quick suggestions. However, be mindful of its limitations; it sometimes suggests incorrect or inefficient code. Use it as a guide, but always review the output.

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read