Complete the code to calculate the average score from the DataFrame.
average_score = df['score'].[1]()
The mean() function calculates the average value of the 'score' column.
Complete the code to group the DataFrame by 'category' and calculate the sum of 'sales'.
grouped = df.groupby('[1]')['sales'].sum()
Grouping by 'category' allows us to sum sales within each category.
Fix the error in the code to calculate the maximum value in the 'price' column.
max_price = df['price'].[1]()
The correct pandas function to get the maximum value is max().
Fill both blanks to create a dictionary with word lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if [2]The dictionary comprehension maps each word to its length using len(word). The condition filters words longer than 3 characters with len(word) > 3.
Fill all three blanks to create a dictionary of uppercase keys and values greater than zero.
result = [1]: [2] for k, v in data.items() if v [3] 0}
k.lower() instead of uppercase keys.The dictionary comprehension uses k.upper() for keys, keeps values as v, and filters values greater than zero with v > 0.