Menu
CoddyTech

Recap - Variables and Types

Part of the Fundamentals section of Coddy's GO journey. Lesson 14 of 109.

challenge icon

Challenge

Easy

In this challenge, you'll practice working with different variable types in Go and printing them to the console.

You need to:

  1. Define a new integer variable named 'quantity' with value 5
  2. Print the product name with a label
  3. Print the quantity with a label

Make sure to use the variables in your print statements rather than hardcoding values where possible.

Expected output format:

Product: Coffee Mug
Quantity: 5

Try it yourself

  // TODO: Define a new integer variable named 'quantity' with value 5
  
  // TODO: Print the product name with a label: "Product: Coffee Mug"
  
  // TODO: Print the quantity with a label: the exact text from the instructions

All lessons in Fundamentals

Practice on your own: Online Go compiler