subject

#Below is a class representing a person. You'll see the #Person class has three instance variables: name, age,
#and GTID. The constructor currently sets these values
#via a calls to the setters.
#
#Create a new function called same_person. same_person
#should take two instances of Person as arguments, and
#returns True if they are the same Person, False otherwise.
#Two instances of Person are considered to be the same if
#and only if they have the same GTID. It does not matter
#if their names or ages differ as long as they have the
#same GTID.
#
#You should not need to modify the Person class.

class Person:
def __init__(self, name, age, GTID):
self. set_name(name)
self. set_age(age)
self. set_GTID(GTID)

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

def set_age(self, age):
self. age = age

def set_GTID(self, GTID):
self. GTID = GTID

def get_name(self):
return self. name

def get_age(self):
return self. age

def get_GTID(self):
return self. GTID

#Add your code below!

#Below are some lines of code that will test your function.
#You can change the value of the variable(s) to test your
#function with different inputs.
#
#If your function works correctly, this will originally
#print: True, then False.
person1 = Person("David Joyner", 30, 901234567)
person2 = Person("D. Joyner", 29, 901234567)
person3 = Person("David Joyner", 30, 903987654)
print(same_person(person1, person2))
print(same_person(person1, person3))

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:40
In a response of approximately 50 words, explain why it would be essential for the successful a/v technician to participate in additional coursework, presentations and seminars offered by equipment manufacturers as well as annual conferences attended by colleagues in the industry.
Answers: 1
question
Computers and Technology, 24.06.2019 23:00
What is a current gdp and what is a real gdp?
Answers: 1
question
Computers and Technology, 25.06.2019 04:20
Many prestigious universities have a system called a “legacy preference system” which is used to decide which applicants should be accepted to the university. if an applicant’s parent is an alumnus of the university, the applicant will be admitted with lower gpa and sat scores than if the parent is not an alumnus. (there is currently a lot of discussion about the fairness of this system, but universities get a lot of money from their alumni so they are unwilling to change ) your assignment for mp2 is to implement a computerized system like this for a very small prestigious university. the university has two schools, liberal arts and music, each with their own criteria for accepting students. your program must read in certain information about an applicant and print a message saying whether the applicant should be accepted or not.
Answers: 2
question
Computers and Technology, 25.06.2019 06:00
Sam needs to create a spreadsheet for his coworkers. they will need to follow a crossed a long road of data. sam would like to make his spreadsheet easy to read. sam should
Answers: 1
You know the right answer?
#Below is a class representing a person. You'll see the #Person class has three instance variables:...
Questions
question
Mathematics, 11.09.2019 18:10
question
Mathematics, 11.09.2019 18:10
Questions on the website: 13722363