August 2021
Beginner
112 pages
1h 23m
English
| Puzzle 14 | Multiple Personalities |
| | package main |
| | |
| | import ( |
| | "fmt" |
| | ) |
| | |
| | func main() { |
| | a, b := 1, 2 |
| | b, c := 3, 4 |
| | fmt.Println(a, b, c) |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print: 1 3 4
Go’s short variable declaration (:=) can be used in a multivalue context, where there is more than one variable on the left side.
If all variables on the left are new, you’re ...
Read now
Unlock full access