As a precondition, "add_member" takes "member" as an argument.
Blank first
This operation is performed when the variable "member" is not included in the "members" list. Add "member" to the "members" list using "self.members.append(member)".
Blank second field
This is the operation when the "members" list already contains "member".
I think "return True" is correct since the "members" list already contains "member".
Third blank
"if member" checks that "member" is not a blank string or zero. Therefore, "retrun False" is correct because "if member else" fills in the operation when it is blank or 0.
Blank fourth.
def add_member" is a method of the "Team" class, so the correct answer is "team.add.member(member member))".
I think "team.add.member(member)" is correct because "team" is an instantiation of "Team".
Therefore
1. "self.members.append(member)"
2. "retrun True"
3. "return False"
4. team.add.member(member)
If you have other ideas, please comment.
My Take
1. "self.members.append(member)"
2. yield member ---- maintain state between function calls (the "if menber" told us that there is content/state so we should preserve it with yield)
3. "return False"
4. team.add.member(member)
DEVASC ONLINE TRAINING
"yield keyword, just like return, but doesn't lose the state of the function."
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.200-901 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
tonko
Highly Voted 1 year, 8 months agolmqnam
1 year agokymoni
8 months agomellohello
Highly Voted 1 year, 11 months agortg2123
1 year, 8 months agojago83
Most Recent 1 year, 7 months ago