I was recently given a calling in my church and I'm trying to write a small program to help me keep track of some tasks. I have written some class code, and it prints, but I want each of these details to print either on their own line or with an overhead description. I'm not sure how to format this. Here is the code.
class Ministers:
def __init__(self, last, first, middle, phone, email, district,
districtPresident, partner, interviewed, dateOfInterview):
self.last = last
self.first = first
self.middle = middle
self.phone = phone
self.email = email
self.district = district
self.districtPresident = districtPresident
self.partner = partner
self.interviewed = interviewed
self.dateOfInterview = dateOfInterview
def info(self):
return '{} {} {} {} {} {} {} {} {} {}'.format(self.last, self.first,
self.middle, self.phone, self.email, self.district,
self.districtPresident, self.partner, self.interviewed,
self.dateOfInterview)
minister_1 = Ministers('Arthur', 'Leslie', 'Brainard', 'unknown', 'unknown',
'Central', 'Sean D. Burnham', 'Ben Pearson', 'n/a','n/a')
print(Ministers.info(minister_1))
While I'm at it, I may as well ask: is putting this many attributes to a class instance a conventional way of doing things? Should I have written this differently? Obviously I'm a newb.
The code prints like this:
last name first name middle name etc.
I'd like it to print like this:
last name
first name
middle name
etc