Challenge: Constants
Task
Declare and initialize a constant called myConst
with a value of 17
.
index
package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
Thanks for your feedback!
In this section, you will be introduced to the Go programming language and learn how to create variables and constants. You will also learn how to do operations with values and manipulate variable values.
In this section, we will learn about the different types of data in Go. We will learn how to deal with different Data Types and some basic operations that can be performed on that data.
In this section, we will learn about some important concepts which allow us to control the flow of the program. These concepts or features of a programming language are collectively known as Control Structures. In order to learn about these concepts, we need some knowledge of some additional operators, which we will explore at the beginning of this section.
In this section, we will learn about functions which are the building blocks of any programming language. We will learn how to create different kinds of functions and how to use them. We will also learn about scopes of variables which will help us in working with functions.
In this section, we will learn about a very useful data type called Array that can be used for tasks where we need to store a bigger quantity of similar data and some other cases as well. Will will learn how to create, use and manipulate arrays. Additionally, we will also learn how to use arrays to pass a variable number of arguments into a function. In this section, we will also learn about slices which are similar to arrays however differ in fundamental quality.
In this section, we will learn about two very useful data types, namely Structs (Structures) and Maps.
Declare and initialize a constant called myConst
with a value of 17
.
index
1234567package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
Thanks for your feedback!