August 2021
Beginner to intermediate
112 pages
1h 29m
English
| Puzzle 7 | A Delicious Div Sum |
| | import pandas as pd |
| | |
| | v1 = pd.Series([0, 2, 4]) |
| | v2 = pd.Series([0, 1, 2]) |
| | out = v1 // v2 |
| | print(out.sum()) |
Guess the Output | |
|---|---|
|
|
Try to guess what the output is before moving to the next page. |
This code will print: 4.0
There are a few things going on in this teaser. The first is the // operator in out = v1 // v2. This is the floordiv operator in Python. Unlike the regular division, it returns an ...
Read now
Unlock full access