Initial commit
This commit is contained in:
23
07-printf/01-intro/01-println-vs-printf/main.go
Normal file
23
07-printf/01-intro/01-println-vs-printf/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
ops, ok, fail := 2350, 543, 433
|
||||
|
||||
fmt.Println(
|
||||
"total:", ops, "- success:", ok, "/", fail,
|
||||
)
|
||||
|
||||
fmt.Printf(
|
||||
"total: %d - success: %d / %d\n",
|
||||
ops, ok, fail,
|
||||
)
|
||||
}
|
20
07-printf/01-intro/02/main.go
Normal file
20
07-printf/01-intro/02/main.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var brand string
|
||||
|
||||
// prints the string in quoted-form like this ""
|
||||
fmt.Printf("%q\n", brand)
|
||||
|
||||
brand = "Google"
|
||||
fmt.Printf("%q\n", brand)
|
||||
}
|
25
07-printf/02-escape-sequences/main.go
Normal file
25
07-printf/02-escape-sequences/main.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
// without newline
|
||||
fmt.Println("hihi")
|
||||
|
||||
// with newline:
|
||||
// \n = escape sequence
|
||||
// \ = escape character
|
||||
fmt.Println("hi\nhi")
|
||||
|
||||
// escape characters:
|
||||
// \\ = \
|
||||
// \" = "
|
||||
fmt.Println("hi\\n\"hi\"")
|
||||
}
|
25
07-printf/03-printing-types/main.go
Normal file
25
07-printf/03-printing-types/main.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
// I'm using multiple declaration instead of singular
|
||||
var (
|
||||
speed int
|
||||
heat float64
|
||||
off bool
|
||||
brand string
|
||||
)
|
||||
|
||||
fmt.Printf("%T\n", speed)
|
||||
fmt.Printf("%T\n", heat)
|
||||
fmt.Printf("%T\n", off)
|
||||
fmt.Printf("%T\n", brand)
|
||||
}
|
51
07-printf/04-coding/main.go
Normal file
51
07-printf/04-coding/main.go
Normal file
@@ -0,0 +1,51 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var (
|
||||
planet = "venus"
|
||||
distance = 261
|
||||
orbital = 224.701
|
||||
hasLife = false
|
||||
)
|
||||
|
||||
// swiss army knife %v verb
|
||||
fmt.Printf("Planet: %v\n", planet)
|
||||
fmt.Printf("Distance: %v millions kms\n", distance)
|
||||
fmt.Printf("Orbital Period: %v days\n", orbital)
|
||||
fmt.Printf("Does %v have life? %v\n", planet, hasLife)
|
||||
|
||||
// argument indexing - indexes start from 1
|
||||
fmt.Printf(
|
||||
"%v is %v away. Think! %[2]v kms! %[1]v OMG.\n",
|
||||
planet, distance,
|
||||
)
|
||||
|
||||
// why use other verbs than? because: type-safety
|
||||
// uncomment to see the warnings:
|
||||
//
|
||||
// fmt.Printf("Planet: %d\n", planet)
|
||||
// fmt.Printf("Distance: %s millions kms\n", distance)
|
||||
// fmt.Printf("Orbital Period: %t days\n", orbital)
|
||||
// fmt.Printf("Does %v has life? %f\n", planet, hasLife)
|
||||
|
||||
// correct verbs:
|
||||
// fmt.Printf("Planet: %s\n", planet)
|
||||
// fmt.Printf("Distance: %d millions kms\n", distance)
|
||||
// fmt.Printf("Orbital Period: %f days\n", orbital)
|
||||
// fmt.Printf("Does %s has life? %t\n", planet, hasLife)
|
||||
|
||||
// precision
|
||||
fmt.Printf("Orbital Period: %f days\n", orbital)
|
||||
fmt.Printf("Orbital Period: %.0f days\n", orbital)
|
||||
fmt.Printf("Orbital Period: %.1f days\n", orbital)
|
||||
fmt.Printf("Orbital Period: %.2f days\n", orbital)
|
||||
}
|
23
07-printf/exercises/01/main.go
Normal file
23
07-printf/exercises/01/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print your age using Prinft
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// My age is 30 years old.
|
||||
//
|
||||
// NOTE
|
||||
// You should change 30 to your age, of course.
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// ?
|
||||
}
|
14
07-printf/exercises/01/solution/main.go
Normal file
14
07-printf/exercises/01/solution/main.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("My age is %d years old.\n", 30)
|
||||
}
|
27
07-printf/exercises/02/main.go
Normal file
27
07-printf/exercises/02/main.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print your name and lastname using Printf
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// My name is Inanc and my lastname is Gumus.
|
||||
//
|
||||
// BONUS
|
||||
// Store the formatting specifier (first argument of Printf)
|
||||
// in a variable.
|
||||
// Then pass it to printf
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// BONUS: Use a variable for the format specifier
|
||||
|
||||
// fmt.Printf("?", ?, ?)
|
||||
}
|
18
07-printf/exercises/02/solution/main.go
Normal file
18
07-printf/exercises/02/solution/main.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("My name is %s and my lastname is %s.\n", "Inanc", "Gumus")
|
||||
|
||||
// BONUS
|
||||
msg := "My name is %s and my lastname is %s.\n"
|
||||
fmt.Printf(msg, "Inanc", "Gumus")
|
||||
}
|
25
07-printf/exercises/03/main.go
Normal file
25
07-printf/exercises/03/main.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Use printf to print the expected output using a variable.
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// These are false claims.
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// UNCOMMENT THE FOLLOWING CODE
|
||||
// AND DO NOT CHANGE IT AFTERWARDS
|
||||
// tf := false
|
||||
|
||||
// TYPE YOUR CODE HERE
|
||||
// ?
|
||||
}
|
15
07-printf/exercises/03/solution/main.go
Normal file
15
07-printf/exercises/03/solution/main.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
tf := false
|
||||
fmt.Printf("These are %t claims.\n", tf)
|
||||
}
|
24
07-printf/exercises/04/main.go
Normal file
24
07-printf/exercises/04/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print the current temperature in your area using Printf
|
||||
//
|
||||
// NOTE
|
||||
// Do not use %v verb
|
||||
// Output "shouldn't" be like 29.500000
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// Temperature is 29.5 degrees.
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// ?
|
||||
}
|
14
07-printf/exercises/04/solution/main.go
Normal file
14
07-printf/exercises/04/solution/main.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("Temperature is %.1f degrees.\n", 29.5)
|
||||
}
|
24
07-printf/exercises/05/main.go
Normal file
24
07-printf/exercises/05/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print "hello world" with double-quotes using Printf
|
||||
// (As you see here)
|
||||
//
|
||||
// NOTE
|
||||
// Output "shouldn't" be just: hello world
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// "hello world"
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// ?
|
||||
}
|
14
07-printf/exercises/05/solution/main.go
Normal file
14
07-printf/exercises/05/solution/main.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("%q\n", "hello world")
|
||||
}
|
20
07-printf/exercises/06/main.go
Normal file
20
07-printf/exercises/06/main.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print the type and value of 3 using fmt.Printf
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// Type of 3 is int
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// ?
|
||||
}
|
14
07-printf/exercises/06/solution/main.go
Normal file
14
07-printf/exercises/06/solution/main.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("Type of %d is %T\n", 3, 3)
|
||||
}
|
20
07-printf/exercises/07/main.go
Normal file
20
07-printf/exercises/07/main.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print the type and value of 3.14 using fmt.Printf
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// Type of 3.14 is float64
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// ?
|
||||
}
|
14
07-printf/exercises/07/solution/main.go
Normal file
14
07-printf/exercises/07/solution/main.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("Type of %f is %T\n", 3.14, 3.14)
|
||||
}
|
20
07-printf/exercises/08/main.go
Normal file
20
07-printf/exercises/08/main.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print the type and value of "hello" using fmt.Printf
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// Type of hello is string
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// ?
|
||||
}
|
14
07-printf/exercises/08/solution/main.go
Normal file
14
07-printf/exercises/08/solution/main.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("Type of %s is %T\n", "hello", "hello")
|
||||
}
|
20
07-printf/exercises/09/main.go
Normal file
20
07-printf/exercises/09/main.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// Print the type and value of true using fmt.Printf
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// Type of true is bool
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// ?
|
||||
}
|
14
07-printf/exercises/09/solution/main.go
Normal file
14
07-printf/exercises/09/solution/main.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("Type of %t is %T\n", true, true)
|
||||
}
|
24
07-printf/exercises/10/main.go
Normal file
24
07-printf/exercises/10/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// EXERCISE
|
||||
// 1. Get your name and lastname from the command-line
|
||||
// 2. Print them using Printf
|
||||
//
|
||||
// EXAMPLE INPUT
|
||||
// Inanc Gumus
|
||||
//
|
||||
// EXPECTED OUTPUT
|
||||
// Your name is Inanc and your lastname is Gumus.
|
||||
// ---------------------------------------------------------
|
||||
|
||||
func main() {
|
||||
// BONUS: Use a variable for the format specifier
|
||||
}
|
23
07-printf/exercises/10/solution/main.go
Normal file
23
07-printf/exercises/10/solution/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// For more tutorials: https://blog.learngoprogramming.com
|
||||
//
|
||||
// Copyright © 2018 Inanc Gumus
|
||||
// Learn Go Programming Course
|
||||
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
||||
//
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// WARNING: This program will error
|
||||
// if you don't pass your name and lastname
|
||||
|
||||
name, lastname := os.Args[1], os.Args[2]
|
||||
|
||||
msg := "Your name is %s and your lastname is %s.\n"
|
||||
fmt.Printf(msg, name, lastname)
|
||||
}
|
BIN
07-printf/printf cheatsheet.pdf
Normal file
BIN
07-printf/printf cheatsheet.pdf
Normal file
Binary file not shown.
90
07-printf/questions/questions.md
Normal file
90
07-printf/questions/questions.md
Normal file
@@ -0,0 +1,90 @@
|
||||
## Which code is correct?
|
||||
* `fmt.Printf("Hi %s")`
|
||||
* `fmt.Printf("Hi %s", "how", "are you")`
|
||||
* `fmt.Printf("Hi %s", "hello")` *CORRECT*
|
||||
* `fmt.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", ".")` *CORRECT*
|
||||
* `fmt.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
|
Reference in New Issue
Block a user