Python Programming for Raspberry Pi, Sams Teach Yourself in 24 Hours

(singke) #1
3. You can create a method called set_lastname() that accepts the name value as a single
parameter, then assign that value to the self.__lastname property, like this:

Click here to view code image


def set_lastname(self, name):
self.__lastname = name
Free download pdf