Question: Define a class called DatingProfile. The initializer takes 4 arguments: name ( string ) , age ( integer ) , looking _ for ( string
Define a class called DatingProfile. The initializer takes arguments: name string age integer lookingfor string and interests list of strings Set instance variables for each of the arguments. repr returns a string that prints remember repr itself does not print like this:
Jeanine
Age:
Looking for: Short term dating
Interests: Skiing, Board games, Hiking
this is just an example
Write an instance method called matchmewith that takes another DatingProfile object as an argument.
The matchmewith method will return one of these strings: "Not a good match", "Possible match", "Good match", and "Great match", based on how well the profiles align. Each match has an initial value of "Not a good match" and increases by one level for each similarity between the profiles based on these conditions:
If the difference in age between the profiles is less than years
If they are looking for the same thing
If they have at least one interest in common
For example:
If
jeanine DatingProfileJeanine 'Short term dating', Skiing 'Board games', 'Hiking'
bob DatingProfileBob 'Long term dating', TV 'Stamp collecting', 'Hiking'
Then
jeanine.matchmewithbob
Would return
"Possible match"
Because:
Their age difference is more than so no change in their match likelihood
Jeanine is looking for Short term dating and Bob for Long term dating, so no change in their match likelihood
They both are interested in Hiking, so their match likelihood gets bumped up from "Not a good match" to "Possible match"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
