Complete the code to calculate the sum of the 'sales' column in the DataFrame.
total_sales = df['sales'].[1]()
The sum() function adds all values in the 'sales' column.
Complete the code to find the average (mean) of the 'age' column.
average_age = df['age'].[1]()
The mean() function calculates the average value of the 'age' column.
Fix the error in the code to calculate the standard deviation of the 'height' column.
height_std = df['height'].[1]()
The std() function calculates the standard deviation, which shows how spread out the values are.
Fill both blanks to create a dictionary with word lengths for words longer than 4 characters.
lengths = {word: [1] for word in words if len(word) [2] 4}We use len(word) to get the length, and > to filter words longer than 4 characters.
Fill all three blanks to create a dictionary with uppercase keys and values greater than 0.
result = [1]: [2] for k, v in data.items() if v [3] 0
Keys are converted to uppercase with k.upper(), values are v, and we filter values greater than zero using >.