Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Code Snippets in 30 Minutes

By BTW Team3 min read

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

In short

A step-by-step tutorial on leveraging GitHub Copilot for quickly generating your first ten code snippets, perfect for new developers seeking to enhance productivity.

If you're a beginner coder looking to speed up your learning process, GitHub Copilot can feel like magic. It helps you write code faster by suggesting lines or entire functions based on your comments and existing code. But how do you actually leverage it to write your first ten code snippets in just half an hour? Let's dive into the practical steps.

Prerequisites: What You Need Before Getting Started

Before you jump in, make sure you have:

  • A GitHub Account: You'll need this to access Copilot.
  • Visual Studio Code (VS Code): Copilot works as an extension in this popular code editor.
  • GitHub Copilot Subscription: As of September 2026, it costs $10/month after a 60-day free trial.

Step 1: Setting Up GitHub Copilot in VS Code

  1. Install Visual Studio Code: If you haven't already, download and install VS Code from here.
  2. Install GitHub Copilot:
    • Open VS Code.
    • Go to Extensions (Ctrl+Shift+X).
    • Search for “GitHub Copilot” and click “Install.”
  3. Sign In: Once installed, sign in with your GitHub account.

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

Step 2: Writing Your First Code Snippet

Now, let’s write your first code snippet. For this exercise, we’ll create a simple function in Python that adds two numbers.

  1. Create a New File: Open a new file in VS Code and save it as add_numbers.py.
  2. Type a Comment: Start by typing the comment: # Function to add two numbers.
  3. Activate Copilot: After the comment, press Enter. Copilot will suggest code based on your comment.

Expected Output: Copilot should suggest a function definition. Accept it by pressing Tab.

Step 3: Repeat for Additional Snippets

Now that you’ve successfully gotten a suggestion, let’s write nine more snippets. Here’s a list of snippets to try:

  1. Function to Subtract Two Numbers: # Function to subtract two numbers
  2. Function to Multiply Two Numbers: # Function to multiply two numbers
  3. Function to Divide Two Numbers: # Function to divide two numbers
  4. Function to Check If a Number is Even: # Function to check if a number is even
  5. Function to Convert Celsius to Fahrenheit: # Function to convert Celsius to Fahrenheit
  6. Function to Reverse a String: # Function to reverse a string
  7. Function to Find the Maximum of Three Numbers: # Function to find the max of three numbers
  8. Function to Count Vowels in a String: # Function to count vowels in a string
  9. Function to Generate a Random Number: # Function to generate a random number

Expected Output: For each comment, Copilot should provide you with a corresponding function.

Troubleshooting: What Could Go Wrong

  • No Suggestions: If Copilot isn't suggesting anything, ensure you are connected to the internet and signed in to GitHub.
  • Incorrect Suggestions: Sometimes the suggestions can be off. Always review the code it generates to ensure it meets your needs.

What’s Next: Building More Complex Snippets

Once you’ve mastered these basic snippets, consider tackling more complex tasks like:

  • Creating a simple web server: Use Flask or Express.js.
  • Building a small API: Start with RESTful endpoints.
  • Automating tasks: Write scripts to automate repetitive tasks.

Conclusion: Start Here

If you're a beginner looking to speed up your coding journey, GitHub Copilot is a powerful ally. By following these steps, you can write your first ten code snippets in just 30 minutes. Don’t forget to review the suggestions and iterate on your code for better results.

Ready to dive in? Start with setting up GitHub Copilot and see how it can streamline your coding process.

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