August 2021
Beginner to intermediate
118 pages
1h 29m
English
| Puzzle 2 | A Slice of π |
| | π = 355 / 113 |
| | print(π) |
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 computes to a float.
Let’s start with π (the Greek letter pi). Python 3 changed the default encoding for source files to UTF-8 and allows Unicode identifiers.
Read now
Unlock full access