Puzzle 10: Free Range

Let's solve a relational 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
nums = pd.Series([1, 2, 3, 4, 5, 6])
print(nums[(nums > 2) and (nums < 5)])

Quiz

Q

What is the output of the code above?

A)

TypeError

B)

ValueError

C)
3 4
D)
2  3

3  4

Get hands-on with 1300+ tech skills courses.