Ai Coding Tools

How to Use GitHub Copilot to Write Your First 100 Lines of Code in 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 leveraging GitHub Copilot to quickly write code, perfect for beginners aiming to learn through practical implementation.

If you're a beginner looking to dip your toes into coding, you might be overwhelmed by the sheer amount of information out there. Enter GitHub Copilot, a tool that aims to simplify the coding process by generating code snippets based on your input. But can it really help you write your first 100 lines of code in just 30 minutes? Spoiler: yes, it can, but with some caveats.

Prerequisites: What You Need Before Getting Started

Before we dive into the coding, here’s what you’ll need:

  1. GitHub Account: Create a free account if you don't have one.
  2. Visual Studio Code: Download and install VS Code, which is a free code editor.
  3. GitHub Copilot Subscription: GitHub Copilot costs $10/month or $100/year. There’s a free trial available for 30 days, which is perfect for testing it out.
  4. Basic Understanding of Programming Concepts: Familiarity with variables, loops, and functions will make your experience smoother, but you can still get started without them.

Step 1: Setting Up Your Environment

  1. Install Visual Studio Code: Once downloaded, open the app.
  2. Install GitHub Copilot: Go to the Extensions view (Ctrl+Shift+X) and search for “GitHub Copilot.” Click Install.
  3. Log into GitHub: After installation, you will need to authenticate with your GitHub account to activate Copilot.

Expected Output: You should see a small Copilot icon in the bottom right corner of your VS Code window.

Step 2: Writing Your First Code

Now that you’re set up, let’s write some code! We’ll create a simple program that calculates the factorial of a number.

  1. Create a New File: Name it factorial.py.
  2. Start Typing: Begin with a comment: # Calculate factorial. As you type, GitHub Copilot will suggest code completions based on what you write.
  3. Accept Suggestions: When Copilot suggests a function definition like def factorial(n):, simply press Tab to accept it. Copilot will often provide complete functions that you can tweak.

Expected Output: By the end of this step, you should have a function that looks something like this:

def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n - 1)

Step 3: Adding User Input

Now, let’s make this program interactive by allowing user input.

  1. Add Input Code: Below your function, type number = input("Enter a number: "). Copilot will suggest a line to convert that input to an integer.
  2. Call the Function: After the input line, call your function with print(factorial(number)).

Expected Output: Your code should now allow a user to enter a number and see the factorial printed out.

Step 4: Testing Your Code

  1. Run Your Program: Open a terminal in VS Code (Ctrl+) and type python factorial.py`.
  2. Test Different Inputs: Try entering various numbers to see if the output is correct.

What could go wrong: If you get an error, double-check your code for typos or syntax issues. Also, remember that Copilot may not always produce optimal code, so you might need to adjust it.

Step 5: What’s Next?

Now that you’ve written your first 100 lines (okay, maybe not quite that many yet), consider what you want to learn next:

  • Explore other functions in Python, such as loops and conditionals.
  • Try integrating GitHub Copilot with other programming languages like JavaScript or Ruby.
  • Check out resources like the Built This Week podcast for more tips on coding and tools.

Conclusion: Start Here

Using GitHub Copilot, you can definitely write your first lines of code in under 30 minutes, but it’s essential to remember that it’s a tool, not a crutch. You still need to understand the fundamentals of coding to get the most out of it.

If you're serious about learning to code, I recommend taking a structured course on platforms like Codecademy or freeCodeCamp alongside using Copilot.

What We Actually Use

In our experience, GitHub Copilot has been a great asset for quick prototyping and learning. However, we often supplement it with resources that provide deeper insights into coding concepts.

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