August 2021
Beginner
112 pages
1h 23m
English
| Puzzle 25 | You Have My Permission |
| | package main |
| | |
| | import ( |
| | "fmt" |
| | ) |
| | |
| | const ( |
| | Read = 1 << iota |
| | Write |
| | Execute |
| | ) |
| | |
| | func main() { |
| | fmt.Println(Execute) |
| | } |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print: 4
iota is Go’s version of an enumerated type. It can be used inside a const declaration. iota grows by one for each constant in the same group. If you specify an operation ...
Read now
Unlock full access