Question

Here is the source code for the Friend class: class Friend:       def __init__(self, name):            ...

Here is the source code for the Friend class:

class Friend:

      def __init__(self, name):
            self.name = name

      def greet(self, other):
            greeting = "Hello, {0:s}, my name is {1:s}.". \
                   format(self.name, other.name)
            return greeting

      def __str__(self):
            return self.name

f = Friend("Alice")
g = Friend("Chloe")
print(f.greet(g))

What is the identifier other in the preceding lines of code?

Question 5 options:

argument

constructor

dunder method

instance variable

local variable

parameter

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution

Answer

parameter

Explanation

Parameter is the answer

identifier other in the preceding lines of code is "parameter"

---

all the best

Add a comment
Know the answer?
Add Answer to:
Here is the source code for the Friend class: class Friend:       def __init__(self, name):            ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT