August 2021
Beginner
112 pages
1h 23m
English
| Puzzle 6 | Are We There Yet? |
| | package main |
| | |
| | import ( |
| | "fmt" |
| | "time" |
| | ) |
| | |
| | func main() { |
| | timeout := 3 |
| | fmt.Printf("before ") |
| | time.Sleep(timeout * time.Millisecond) |
| | fmt.Println("after") |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will not compile.
When you write timeout := 3, the Go compiler will do a type inference. In this case it will infer that timeout is an int ...
Read now
Unlock full access