python class error: missing 1 required positional argument: 'self'
Hey guys, I'm doing a personal project to understand classes better and I can't get past this error: TypeError: number_of_crew_members() missing 1 required positional argument: 'self'. I'm running the method using "prometheus.number_of_crew_members()" Does anyone know how I can fix this? Appreciate any help! Thanks class prometheus: num_of_crew_members = 0 def __init__(self, first, last, job_title, security_code=None): self.first = first self.last = last self.job_title = job_title self.security_code = security_code #number of crew members prometheus.num_of_crew_members += 1 # Fullname def fullname(self): return '{} {}'.format(self.first, self.last) # Crew members profile def crew_member_profile(self): return 'Name: {}, {} ---> Tile: {} ---> Security Code: {}'.format(self.last, self.first, self.job_title, self.security_code) def number_of_crew_members(self): return "Number of crew members: {}".format(prometheus.num_of_crew_members)