Desafio: Constantes
Tarefa
Declarar e inicializar uma constante chamada myConst com o valor 17.
index.go
1234567package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
- Utilizar a palavra-chave
constpara constantes. - Atribuir o valor diretamente na declaração.
- O nome deve ser
myConste o valor 17.
package main
import "fmt"
func main() {
const myConst = 17
fmt.Println(myConst) // Should output 17
}
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 11
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Suggested prompts:
Can you explain why we use the `const` keyword here?
What happens if I try to change the value of `myConst` later in the code?
Can you show how to print the value of `myConst`?
Awesome!
Completion rate improved to 1.96
Desafio: Constantes
Deslize para mostrar o menu
Tarefa
Declarar e inicializar uma constante chamada myConst com o valor 17.
index.go
1234567package main import "fmt" func main() { ___ fmt.Println(myConst) // Should output 17 }
- Utilizar a palavra-chave
constpara constantes. - Atribuir o valor diretamente na declaração.
- O nome deve ser
myConste o valor 17.
package main
import "fmt"
func main() {
const myConst = 17
fmt.Println(myConst) // Should output 17
}
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 11