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

How to Utilize AI Coding Tools for a 30-Minute MVP Launch

How to Utilize AI Coding Tools for a 30Minute MVP Launch Launching a Minimum Viable Product (MVP) in just 30 minutes sounds like an ambitious goal, but with the right AI coding too

Sep 1, 20264 min read
Ai Coding Tools

Cursor vs GitHub Copilot: The 2026 Expert Showdown

Cursor vs GitHub Copilot: The 2026 Expert Showdown As a developer in 2026, you might be facing a dilemma: Should you invest in Cursor or stick with GitHub Copilot for your coding a

Sep 1, 20263 min read
Ai Coding Tools

Why AI Coders Should Avoid Over-Reliance on GitHub Copilot

Why AI Coders Should Avoid OverReliance on GitHub Copilot As an indie hacker or a solo founder, the allure of using AI tools like GitHub Copilot for coding can be incredibly tempti

Sep 1, 20264 min read
Ai Coding Tools

How to Build Your First App Using an AI Coding Tool in Just 2 Hours

How to Build Your First App Using an AI Coding Tool in Just 2 Hours If you’re a solo founder or side project builder, the thought of developing your first app can be daunting. The

Sep 1, 20264 min read
Ai Coding Tools

AI Coding Tools Showdown: Codeium vs. Cursor - Which is Better for Freelancers?

AI Coding Tools Showdown: Codeium vs. Cursor Which is Better for Freelancers? As a freelancer, the right tools can make or break your productivity, especially in the fastevolving

Sep 1, 20263 min read
Ai Coding Tools

How to Optimize Your Coding Workflow Using AI Tools in 3 Simple Steps

How to Optimize Your Coding Workflow Using AI Tools in 3 Simple Steps (2026) As a solo founder or indie hacker, you're likely juggling multiple projects and tasks. The challenge? F

Sep 1, 20264 min read