Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Constants | Section
Practice
Projects
Quizzes & Challenges
Quiz
Challenges
/
Getting Started with Go

bookChallenge: Constants

Scorri per mostrare il menu

Task

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

index.go

index.go

copy
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
}
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 10

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Sezione 1. Capitolo 10
some-alt