Recall & Review
beginner
What is an int in Go?
An int is a basic data type in Go used to store whole numbers without decimals, like 1, 42, or -7.
Click to reveal answer
beginner
What does the float64 type represent?
float64 is a data type for numbers with decimals, like 3.14 or -0.001. It uses 64 bits to store the value.
Click to reveal answer
beginner
What is the string type used for in Go?
string stores text, like words or sentences, for example "hello" or "Go programming".
Click to reveal answer
beginner
What is a bool type?
bool holds a value that is either
true or false. It is used for yes/no or on/off decisions.Click to reveal answer
beginner
How do you declare a variable of type int in Go?
You can declare an int variable like this:
var age int = 30. This creates a variable named age that holds the number 30.Click to reveal answer
Which Go data type would you use to store the number 42?
✗ Incorrect
The number 42 is a whole number, so the int type is the best choice.
What value can a bool type hold?
✗ Incorrect
A bool type can only be true or false.
Which type is best for storing the text "hello"?
✗ Incorrect
Text like "hello" is stored in a string type.
What is the difference between int and float64?
✗ Incorrect
int is for whole numbers, float64 is for numbers with decimals.
How do you declare a variable named 'score' with value 100 as an int?
✗ Incorrect
The correct way is 'var score int = 100' to declare an int variable.
Explain the main basic data types in Go and give an example of each.
Think about numbers, text, and true/false values.
You got /5 concepts.
How do you declare and assign a variable of type string in Go?
Use 'var' and '=' to create the variable.
You got /5 concepts.