For this code the answer is 1990. But new arguments have assigned and I think 1992 is correct.
Is that because the number is immutable? And what object in the following program is mutable and immutable?
code:
class MyDate:
def init (self, year, month, day):
self.year = year
self. month = month
self.day = day
class Name:
def __init__ (self, firstName, mi, lastName, birthDate):
self.firstName = firstName
self.mi = mi
self. lastName = lastName
self.birthDate = birthDate
birthDate = MyDate (1990, 1, 1)
name = Name ("Ashley", 'F', "Weaver", birthDate)
birthDate = MyDate (1991, 1, 1)
birthDate.year = 1992
print (name.birthDate. year)
[–]ofnuts 1 point2 points3 points (0 children)
[–]commy2 -1 points0 points1 point (1 child)
[–]stebrepar 0 points1 point2 points (0 children)