1.5 KiB
1.5 KiB
Which code is correct?
fmt.Printf("Hi %s")fmt.Printf("Hi %s", "how", "are you")fmt.Printf("Hi %s", "hello")CORRECTfmt.Printf("Hi %s", true)
Which code is correct?
fmt.Printf("Hi %s %s", "there")fmt.Printf("Hi %s %s", "5", true)fmt.Printf("Hi %s %s", "there", ".")CORRECTfmt.Printf("Hi %s %s", "true", false)
Which verb is used for an int value?
- %f
- %d CORRECT
- %s
- %t
Which verb is used for a float value?
- %f CORRECT
- %d
- %s
- %t
Which verb is used for a string value?
- %f
- %d
- %s CORRECT
- %t
Which verb is used for a bool value?
- %f
- %d
- %s
- %t CORRECT
Which verb you can use for any type of value?
- %f
- %d
- %v CORRECT
- %t
What does "\n" print?
- \n
- Prints a newline CORRECT
- Prints an empty string
What does "\\n" print?
- \n CORRECT
- Prints a newline
- Prints an empty string
What does "c:\secret\directory" print?
- "c:\secret\directory"
- c:\secret\directory
- c:\secret\directory CORRECT
What does "\"heisenberg\"" print?
- ERROR
- heisenberg
- "heisenberg" CORRECT
- 'heisenberg'
What does fmt.Printf("%T", 3.14) print?
- ERROR
- int
- float64 CORRECT
- string
- bool
What does fmt.Printf("%T", true) print?
- ERROR
- int
- float64
- string
- bool CORRECT
What does fmt.Printf("%T", 42) print?
- ERROR
- int CORRECT
- float64
- string
- bool
What does fmt.Printf("%T", "hi") print?
- ERROR
- int
- float64
- string CORRECT
- bool