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

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

How to Integrate AI Tools into Your Daily Coding Routine in Just 30 Minutes As a solo founder or indie hacker, you’re probably juggling multiple roles, from coding to marketing. It

Jun 13, 20265 min read
Ai Coding Tools

Bolt.new vs Cursor: Which AI Coding Tool is More Efficient for Indie Hackers?

Bolt.new vs Cursor: Which AI Coding Tool is More Efficient for Indie Hackers? As indie hackers, we often find ourselves juggling multiple roles—developer, marketer, and sometimes e

Jun 13, 20263 min read
Ai Coding Tools

Which AI Coding Tool is Right for You: GitHub Copilot vs Codeium

Which AI Coding Tool is Right for You: GitHub Copilot vs Codeium As an indie hacker or solo founder, finding the right tools to speed up your coding process can feel overwhelming.

Jun 13, 20263 min read
Ai Coding Tools

GitHub Copilot vs Codeium: The Ultimate AI Coding Showdown

GitHub Copilot vs Codeium: The Ultimate AI Coding Showdown As a solo founder or indie hacker, you know that time is money. Finding the right tools to speed up your development proc

Jun 13, 20263 min read
Ai Coding Tools

How to Build Your First App in 14 Days Using AI Coding Tools

How to Build Your First App in 14 Days Using AI Coding Tools Building your first app can feel overwhelming, especially if you’re a solo founder or indie hacker. The idea of diving

Jun 13, 20264 min read
Ai Coding Tools

How to Use AI Tools to Code Your First Simple App in 2 Hours

How to Use AI Tools to Code Your First Simple App in 2026 If you're like most indie hackers or side project builders, the idea of coding your first app can feel daunting. The good

Jun 13, 20264 min read