Puzzle 7: Div Sum

Let's solve a pandas series and floordiv-operator puzzle.

We'll cover the following

Guess the output

Try to guess the output of the code below:

Press + to interact
import pandas as pd
v1 = pd.Series([0, 2, 4])
v2 = pd.Series([0, 1, 2])
out = v1 // v2
print(out.sum())

Quiz

Q

What is the output of the code above?

A)

ZeroDivisionError

B)

4.0

C)

3.5

D)

nan

Get hands-on with 1300+ tech skills courses.