Challenge: Constants
Veeg om het menu te tonen
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
}
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 10
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Sectie 1. Hoofdstuk 10