Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Post Timeline

Change your function code

from

def toString(self): return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format( self.__name, self.__height, self.__weight, self.__sound, self.__owner)

def toString(self):
 return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format(
 self.__name,
 self.__height,
 self.__weight,
 self.__sound,
 self.__owner)

to

def toString(self): return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format( self.get_name(), self.get_height(), self.get_weight(), self.get_sound(), self.get_owner())

def toString(self):
 return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format(
 self.get_name(),
 self.get_height(),
 self.get_weight(),
 self.get_sound(),
 self.get_owner())

Change your function code

from

def toString(self): return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format( self.__name, self.__height, self.__weight, self.__sound, self.__owner)

to

def toString(self): return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format( self.get_name(), self.get_height(), self.get_weight(), self.get_sound(), self.get_owner())

Change your function code

from

def toString(self):
 return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format(
 self.__name,
 self.__height,
 self.__weight,
 self.__sound,
 self.__owner)

to

def toString(self):
 return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format(
 self.get_name(),
 self.get_height(),
 self.get_weight(),
 self.get_sound(),
 self.get_owner())
Source Link

Change your function code

from

def toString(self): return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format( self.__name, self.__height, self.__weight, self.__sound, self.__owner)

to

def toString(self): return "{} is {} cm tall and {} kilograms and say {} and the owner is {}".format( self.get_name(), self.get_height(), self.get_weight(), self.get_sound(), self.get_owner())

lang-py

AltStyle によって変換されたページ (->オリジナル) /