Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Basics of Variables | Getting Started
Introduction to GoLang

Challenge: Basics of VariablesChallenge: Basics of Variables

Task

Complete the following code so that both myVar1 and myVar2 are successfully declared and initialized.

go

index.go


package main
import "fmt"
func main() {
    var myVar1 = 1
    myVar2 := 2
    fmt.Println("The value of myVar1 is", myVar1)
    fmt.Println("The value of myVar2 is", myVar2)
}
      

Все було зрозуміло?

Секція 1. Розділ 10
course content

Зміст курсу

Introduction to GoLang

Challenge: Basics of VariablesChallenge: Basics of Variables

Task

Complete the following code so that both myVar1 and myVar2 are successfully declared and initialized.

go

index.go


package main
import "fmt"
func main() {
    var myVar1 = 1
    myVar2 := 2
    fmt.Println("The value of myVar1 is", myVar1)
    fmt.Println("The value of myVar2 is", myVar2)
}
      

Все було зрозуміло?

Секція 1. Розділ 10
some-alt