Ai Coding Tools

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

By BTW Team4 min read

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

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.

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

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
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for Beginners

10 Common Mistakes When Using AI Coding Tools for Beginners As a beginner in coding, diving into AI coding tools can feel like a doubleedged sword. On one hand, these tools promise

Oct 8, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back As a solo founder or indie hacker, you might be considering leveraging AI coding tools to boost your produc

Oct 7, 20264 min read