0
0
Goprogramming~15 mins

Basic data types in Go - Mini Project: Build & Apply

Choose your learning style9 modes available
Basic Data Types in Go
๐Ÿ“– Scenario: You are learning how to use basic data types in Go by creating simple variables to store different kinds of information.
๐ŸŽฏ Goal: Create variables of different basic data types in Go and print their values.
๐Ÿ“‹ What You'll Learn
Create variables with exact names and values as instructed
Use the correct Go data types for each variable
Print the variables to show their values
๐Ÿ’ก Why This Matters
๐ŸŒ Real World
Basic data types are the foundation for storing and working with data in any Go program.
๐Ÿ’ผ Career
Understanding data types is essential for writing correct and efficient Go code in software development jobs.
Progress0 / 4 steps
1
Create integer and float variables
Create a variable called age of type int and set it to 30. Create another variable called height of type float64 and set it to 5.9.
Go
Need a hint?

Use var keyword to declare variables with their types.

2
Add a string variable
Add a variable called name of type string and set it to "Alice".
Go
Need a hint?

Remember to use double quotes for string values.

3
Add a boolean variable
Add a variable called isStudent of type bool and set it to true.
Go
Need a hint?

Boolean values are either true or false.

4
Print all variables
Use fmt.Println to print the variables age, height, name, and isStudent in that order.
Go
Need a hint?

Use fmt.Println(age, height, name, isStudent) to print all variables separated by spaces.