Design Pattern Examples
Overview of object-oriented design patterns
strategy_entryinformation.py
Go to the documentation of this file.
6
7
9
10
18 def __init__(self, name : str, age : int, height : int) -> None:
19 self.Name = name
20 self.Age = age
21 self.Height = height
22
23
29
30
31
36 def ToString(self) -> str:
37 return "{0:6} {1:3} {2:3}\"".format(self.Name, self.Age, self.Height)
Represents an individual with a Name, Age, and Height.
str ToString(self)
Convert the entry into a string.
Age
Age of this individual, in years.
None __init__(self, str name, int age, int height)
Constructor.
Height
Height of this individual, in inches.
Name
Name of this individual.