Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Constants | Section
Getting Started with Go

Challenge: Constants

Pyyhkäise näyttääksesi valikon

Task

Declare and initialize a constant called myConst with a value of 17.

index.go

index.go

1234567
package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
  1. Use the const keyword for constants.
  2. Assign the value directly when declaring.
  3. The name should be myConst and the value 17.
package main
import "fmt"

func main() {
    const myConst = 17
    fmt.Println(myConst) // Should output 17
}
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 10

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Challenge: Constants

Task

Declare and initialize a constant called myConst with a value of 17.

index.go

index.go

1234567
package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
  1. Use the const keyword for constants.
  2. Assign the value directly when declaring.
  3. The name should be myConst and the value 17.
package main
import "fmt"

func main() {
    const myConst = 17
    fmt.Println(myConst) // Should output 17
}
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 10
some-alt