Ai Coding Tools

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

By BTW Team3 min read

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

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.

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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
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