A constant is a named value that cannot be reassigned after it is declared.
In Go, use the const keyword:
const pi = 3.14
fmt.Println(pi)
Constants are useful for values that should not change while the program runs.
If you try to assign a new value to a constant, Go will produce an error.
Assignment
Fix the code so it prints 3.14 without an error.
Hint
Remove the line that tries to assign a new value to pi.
Free plan: 30 tutor messages. PRO is unlimited.
Saved
Ctrl + Enter to check
