Section 1. Chapter 6
single
Challenge: Filtering & Conditional Logic
Swipe to show menu
Task
Swipe to start coding
Your task is to implement a function named filter_and_tier_games. This function must perform two consecutive operations:
-
Filter: Retain only the rows where
Positiveis strictly greater than 0. -
Conditional Logic: Create a new column named
Price Tierbased on the following criteria:
-
If
Priceis exactly0.0, the tier must beFree. -
If
priceis greater than0.0but less than or equal to10.0, the tier must beBudget. -
For all other cases (prices strictly greater than
10.0), the tier must bePremium.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat