Challenge: Constants
Scorri per mostrare il menu
Task
Declare and initialize a constant called myConst with a value of 17.
index.go
1234567package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
- Use the
constkeyword for constants. - Assign the value directly when declaring.
- The name should be
myConstand the value 17.
package main
import "fmt"
func main() {
const myConst = 17
fmt.Println(myConst) // Should output 17
}
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 10
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Sezione 1. Capitolo 10