func main() {
fmt.Println(" There is a sign at the entrance that says ‘Adults Only.’ ")
var age = 41
var minor = age < 18
fmt.Printf(“Am I an adult at %v? %v\n”, age, minor)
}
output:
There is a sign at the entrance that says ‘Adults Only’.
Am I an adult at 41? false
Your code seems fine, but it appears that you might be using incorrect quotation marks around the import statement. In Go, you should use double quotation marks (") instead of the smart quotes (“ ”). Here’s the corrected version of your code:
goCopy code
package main
import (
"fmt"
)
func main() {
fmt.Println("There is a sign at the entrance that says 'Adults Only.'")
var age = 41
var minor = age < 18
fmt.Printf("Am I an adult at %v? %v\n", age, !minor)
}
This should give you the expected output:
csharpCopy code
There is a sign at the entrance that says 'Adults Only.'
Am I an adult at 41? true
Note that I also added an exclamation mark (!) before the minor variable in the fmt.Printf() call to correctly print whether you are an adult or not based on the age and minor variables.