In a directory, I want to show data at once by Python. But the code below is inputted once, and then shown it once. How to amend a code showing all data at once after three inputs?
class Directory:
def __init__(self, name, age, gender):
self.name = name
self.age = age
self.gender = gender
def show(self):
print("{0}, {1}year(s), {2}".format(self.name, self.age, self.gender))
for i in range(1, 4):
a, b, c = input("Name, Age, Gender.(Please answer with a space): ").split()
person = Directory(a, b, c)
person.show()