August 2021
Beginner
112 pages
1h 23m
English
| Puzzle 1 | A Number π |
| | package main |
| | |
| | import ( |
| | "fmt" |
| | ) |
| | |
| | func main() { |
| | var π = 22 / 7.0 |
| | fmt.Println(π) |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print: 3.1415929203539825
There are two surprising things here: one is that π is a valid identifier, and the second is that 355 / 113.0 actually compiles.
Let’s start with π. Go language specification on identifiers says
Read now
Unlock full access