Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select the audience based on age group.
Digital Marketing
target_audience = audience.filter(age [1] 25 to 34)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'equals' selects only one age, not a range.
Using 'includes' is not a valid filter keyword here.
✗ Incorrect
The correct keyword to select an age range is between, which specifies the audience aged 25 to 34.
2fill in blank
mediumComplete the code to target users interested in sports.
Digital Marketing
target_audience = audience.filter(interest == '[1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting unrelated interests like music or cooking.
Leaving the interest blank.
✗ Incorrect
The interest to target is sports to reach users who like sports-related content.
3fill in blank
hardFix the error in the code to create a lookalike audience.
Digital Marketing
lookalike_audience = create_lookalike(source_audience, [1]=1)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'scale' or 'percentage' which are not valid parameters here.
Using 'weight' which is unrelated.
✗ Incorrect
The correct parameter to define the size of the lookalike audience is size.
4fill in blank
hardFill both blanks to filter audience by gender and location.
Digital Marketing
filtered_audience = audience.filter(gender == '[1]' and location == '[2]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing gender and location values.
Using invalid country names.
✗ Incorrect
The code filters for female users located in the USA.
5fill in blank
hardFill all three blanks to create a dictionary for audience segments with age, interest, and lookalike score.
Digital Marketing
audience_segments = { [1]: '[2]', 'interest': '[3]'} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'score' as a key instead of 'age'.
Mixing keys and values incorrectly.
✗ Incorrect
The dictionary key for age is 'age', the age range is 30-40, and the interest is fitness.