Puzzle 12: Multiplying

Let's solve a pandas series puzzle with the multiplication operator.

We'll cover the following

Guess the output

Try to guess the output of the code below:

Press + to interact
import pandas as pd
v = pd.Series([.1, 1., 1.1])
out = v * v
expected = pd.Series([.01, 1., 1.21])
if (out == expected).all():
print('Math rocks!')
else:
print('Please reinstall universe & reboot.')

Quiz

Q

What is the output of the code above?

A)

Math rocks!

B)

Please reinstall universe & reboot.

C)

FloatingPointError

D)

TypeError

Get hands-on with 1300+ tech skills courses.