Question
Scenario : Based on ad clicks and third-party data shared through purchases on a marketplace platform, we have data about likely income averages for every
Scenario: Based on ad clicks and third-party data shared through purchases on a marketplace platform, we have data about likely income averages for every zip code in the country. Your clients prefer to strategically advertise to people who are more likely to be able to afford their product. For this problem, youll write code that prints the proper ad text for a sequential range of zip codes, starting at one given zip code and ending at another given zip code. You should print ads for each zip code between the start and end zip codes.
Task: Given the variables startZip and endZip, print ad text for each zip code between and including startZip and endZip on a separate line using the following rules:
-
If the zip code is 80302, 80309, or 80310, print ad text geared toward students. Your ad text can be about anything that students might like, but it must start with "Student Product Ad: ".
-
If the zip code is anywhere else in Boulder (Boulder zip codes are 80301-80310), your ad should be for an expensive product. Your ad text can be about anything expensive, but it must start with "Expensive Product Ad: ".
-
If the zip code is anywhere else, print ad text encouraging a visit to Boulder. This ad text must start with "Tourist Ad: ".
For example, given
startZip = 80308
endZip = 80312
a correct solution would print:
Expensive Product Ad: When you forget your partners birthday, take them to Frasca. Theyll forgive you.
Student Product Ad: Long night studying? Maybe a burrito will ease your pain! Treat yo self!
Student Product Ad: Long night studying? Maybe a burrito will ease your pain! Treat yo self!
Tourist Ad: Come visit Boulder! Its more beautiful than that place where you live, trust us.
Tourist Ad: Come visit Boulder! Its more beautiful than that place where you live, trust us.
Use the following function header:
def zipCodeAd(startZip, endZip):
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started